File tree Expand file tree Collapse file tree 8 files changed +79
-33
lines changed Expand file tree Collapse file tree 8 files changed +79
-33
lines changed Original file line number Diff line number Diff line change 77 android : icon =" @drawable/ic_launcher"
88 android : label =" "
99 android : theme =" @style/AppTheme" >
10- <activity
11- android : name =" .activities.TransitionFirstActivity"
12- android : label =" " >
13-
14-
1510
11+ <activity
12+ android : name =" .activities.TransitionFirstActivity" >
1613 </activity >
14+
1715 <activity
1816 android : name =" .activities.TransitionSecondActivity"
1917 android : label =" @string/title_activity_my_activity2" >
2018 </activity >
21- <activity
22- android : name =" .NavDrawerActivity"
23- android : label =" @string/title_activity_nav_drawer" >
24- </activity >
25- <activity android : name =" .activities.SlidingActivity" >
2619
27- </activity >
2820 <activity
29- android : name =" .activities.ColorActivity "
30- android : label = " @string/title_activity_color " >
21+ android : name =" .activities.SlidingActivity " >
22+ </ activity >
3123
24+ <activity android : name =" .activities.DialerSampleActivity" >
3225 <intent-filter >
3326 <action android : name =" android.intent.action.MAIN" />
3427 <category android : name =" android.intent.category.LAUNCHER" />
3528 </intent-filter >
29+ </activity >
3630
31+ <activity
32+ android : name =" .activities.ColorActivity"
33+ android : label =" @string/title_activity_color" >
3734 </activity >
3835 </application >
39-
4036</manifest >
Original file line number Diff line number Diff line change 2323import android .support .v7 .widget .Toolbar ;
2424
2525import com .saulmm .material .R ;
26+ import com .saulmm .material .slidingtabs .adapter .DialerAdapter ;
2627import com .saulmm .material .slidingtabs .adapter .SamplePagerAdapter ;
2728import com .saulmm .material .slidingtabs .views .SlidingTabLayout ;
2829
2930public class DialerSampleActivity extends ActionBarActivity {
3031
31- private ActionBarDrawerToggle mDrawerToggle ;
32-
3332 @ Override
3433 protected void onCreate (Bundle savedInstanceState ) {
3534
@@ -43,14 +42,15 @@ protected void onCreate(Bundle savedInstanceState) {
4342 private void configureToolbar () {
4443
4544 Toolbar mainToolbar = (Toolbar ) findViewById (R .id .activity_dialer_toolbar );
45+ mainToolbar .setTitleTextColor (getResources ().getColor (R .color .theme_dialer_accent ));
4646 setSupportActionBar (mainToolbar );
4747 getSupportActionBar ().setTitle ("Sliding" );
4848 }
4949
5050 private void configurePager () {
5151
5252 ViewPager mViewPager = (ViewPager ) findViewById (R .id .activity_dialer_pager );
53- mViewPager .setAdapter (new SamplePagerAdapter (this ));
53+ mViewPager .setAdapter (new DialerAdapter (this ));
5454
5555 SlidingTabLayout mSlidingTabLayout = (SlidingTabLayout ) findViewById (R .id .activity_dialer_tabs );
5656 mSlidingTabLayout .setViewPager (mViewPager );
Original file line number Diff line number Diff line change 1+ package com .saulmm .material .slidingtabs .adapter ;
2+
3+ import android .content .Context ;
4+ import android .support .v4 .view .PagerAdapter ;
5+ import android .view .LayoutInflater ;
6+ import android .view .View ;
7+ import android .view .ViewGroup ;
8+
9+ import com .saulmm .material .R ;
10+
11+ @ SuppressWarnings ("FieldCanBeLocal" )
12+ public class DialerAdapter extends PagerAdapter {
13+
14+ private final String [] TITLES = {"SPEED DIAL" , "RECENTS" , "CONTACTS" };
15+ private Context context ;
16+
17+ public DialerAdapter (Context context ) {
18+ this .context = context ;
19+ }
20+
21+ @ Override
22+ public int getCount () {
23+ return TITLES .length ;
24+ }
25+
26+
27+ @ Override
28+ public boolean isViewFromObject (View view , Object o ) {
29+ return o == view ;
30+ }
31+
32+
33+ @ Override
34+ public CharSequence getPageTitle (int position ) {
35+ return TITLES [position ];
36+ }
37+
38+ @ Override
39+ public Object instantiateItem (ViewGroup container , int position ) {
40+
41+ View view = LayoutInflater .from (context ).inflate (R .layout .item_sliding_pager ,
42+ container , false );
43+
44+ container .addView (view );
45+
46+ return view ;
47+ }
48+
49+ @ Override
50+ public void destroyItem (ViewGroup container , int position , Object object ) {
51+ container .removeView ((View ) object );
52+ }
53+ }
Original file line number Diff line number Diff line change 1313 android : visibility =" invisible" />
1414
1515 <View
16- android : id =" @+id/toolbar "
16+ android : id =" @+id/dialer_toolbar "
1717 android : layout_width =" match_parent"
1818 android : background =" ?android:colorPrimary"
1919 android : layout_height =" ?attr/actionBarSize" />
2626 android : paddingLeft =" 72dp"
2727 android : paddingRight =" 16dp"
2828 android : transitionName =" holder1"
29- android : layout_below =" @id/toolbar "
29+ android : layout_below =" @id/dialer_toolbar "
3030 android : background =" ?android:colorPrimary" >
3131
3232 <TextView
Original file line number Diff line number Diff line change 99 android : id =" @+id/activity_dialer_toolbar"
1010 android : layout_height =" wrap_content"
1111 android : layout_width =" match_parent"
12+
1213 android : background =" ?android:colorPrimary"
1314 android : minHeight =" ?attr/actionBarSize" />
1415
2728 <View
2829 android : layout_width =" match_parent"
2930 android : layout_height =" 1dp"
30- android : background =" @color/theme_default_primary "
31+ android : background =" ?android:colorPrimary "
3132 android : elevation =" 10dp" />
3233
3334 <android .support.v4.view.ViewPager
Original file line number Diff line number Diff line change 3535 android : name =" com.saulmm.material.fragments.NavigationFragment" />
3636
3737 </android .support.v4.widget.DrawerLayout>
38-
39-
4038</LinearLayout >
4139
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<resources >
3-
4-
53 <style name =" AppTheme" parent =" Theme.AppCompat.Light.NoActionBar" >
64
75 <!-- android theme colors -->
8- <item name =" android:colorPrimary" >@color/theme_default_primary</item >
9- <item name =" android:windowTranslucentStatus" >true</item >
10- <item name =" android:windowTranslucentNavigation" >true</item >
11- <item name =" android:colorControlActivated" >@color/accent</item >
12- <item name =" android:colorAccent" >@color/accent</item >
6+ <item name =" android:colorPrimary" >@color/theme_dialer_primary</item >
7+ <item name =" android:colorPrimaryDark" >@color/theme_dialer_high</item >
8+ <item name =" android:colorAccent" >@color/theme_dialer_accent</item >
139
1410 <!-- android transitions -->
1511 <item name =" android:windowContentTransitions" >true</item >
5248 <item name =" android:fontFamily" >sans-serif-medium</item >
5349 <item name =" android:textColor" >#FFF</item >
5450 </style >
55-
56- <style name =" AppTheme2" parent =" Theme.AppCompat.Light.NoActionBar" >
57- </style >
58-
5951</resources >
Original file line number Diff line number Diff line change 88 <color name =" accent" >#EEFF41</color >
99 <color name =" gray_row_color" >#ff515252</color >
1010
11+
12+ <!-- Dialer theme -->
13+ <color name =" theme_dialer_high" >#0277BD</color >
14+ <color name =" theme_dialer_primary" >#0288D1</color >
15+ <color name =" theme_dialer_accent" >#FFF</color >
16+
1117 <color name =" color_set_1_primary" >#4fc3f7</color >
1218 <color name =" color_set_1_accent" >#009688</color >
1319
You can’t perform that action at this time.
0 commit comments