From eb20707d8db3aef321ae30cb80faada5e3cd7b4d Mon Sep 17 00:00:00 2001 From: Saul M Date: Sat, 8 Nov 2014 16:55:36 +0100 Subject: [PATCH] ended dialer activity --- app/build.gradle | 3 +- app/src/main/AndroidManifest.xml | 7 +- .../material/activities/ColorActivity.java | 8 +- .../activities/DialerSampleActivity.java | 150 +++++++++++++++--- .../activities/TransitionFirstActivity.java | 6 +- .../activities/TransitionSecondActivity.java | 4 +- .../fragments/NavigationFragment.java | 3 +- .../fragments/SamplePageFragment.java | 22 +++ .../fragments/SlidingTabFragment.java | 6 +- .../utils/{Utils.java => GUIUtils.java} | 25 ++- .../views/adapters/DialerPagerAdapter.java | 53 ------- .../views/adapters/SamplePagerAdapter.java | 11 +- .../views/widgets/SlidingTabLayout.java | 34 +++- app/src/main/res/anim/translate_down_off.xml | 19 +++ app/src/main/res/anim/translate_down_on.xml | 19 +++ .../main/res/drawable/ripple_dialer_call.xml | 12 ++ .../main/res/drawable/ripple_dialer_idle.xml | 12 ++ app/src/main/res/drawable/ripple_round.xml | 2 +- app/src/main/res/layout/activity_color.xml | 37 +++-- app/src/main/res/layout/activity_dialer.xml | 64 ++++++-- ...er.xml => fragment_dialer_sample_page.xml} | 15 +- ...liding.xml => fragment_dialer_sliding.xml} | 12 +- app/src/main/res/layout/list_item_dialer.xml | 10 ++ app/src/main/res/layout/view_fab_button.xml | 6 +- app/src/main/res/values-v21/styles.xml | 1 + app/src/main/res/values/colors.xml | 2 + app/src/main/res/values/strings.xml | 26 ++- 27 files changed, 412 insertions(+), 157 deletions(-) create mode 100644 app/src/main/java/com/saulmm/material/fragments/SamplePageFragment.java rename app/src/main/java/com/saulmm/material/utils/{Utils.java => GUIUtils.java} (77%) delete mode 100644 app/src/main/java/com/saulmm/material/views/adapters/DialerPagerAdapter.java create mode 100644 app/src/main/res/anim/translate_down_off.xml create mode 100644 app/src/main/res/anim/translate_down_on.xml create mode 100644 app/src/main/res/drawable/ripple_dialer_call.xml create mode 100644 app/src/main/res/drawable/ripple_dialer_idle.xml rename app/src/main/res/layout/{item_sliding_pager.xml => fragment_dialer_sample_page.xml} (55%) rename app/src/main/res/layout/{fragment_sliding.xml => fragment_dialer_sliding.xml} (80%) create mode 100644 app/src/main/res/layout/list_item_dialer.xml diff --git a/app/build.gradle b/app/build.gradle index 352f047..9a7c46a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,10 +19,9 @@ android { } } - dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - + compile 'com.android.support:cardview-v7:21.0.0' compile 'com.android.support:appcompat-v7:21.0.0' compile 'com.android.support:support-v4:21.0.0' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a654348..f0de5bb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,7 +21,9 @@ android:name=".activities.SlidingActivity" > - + + @@ -30,7 +32,6 @@ - + android:label="@string/title_activity_color" /> diff --git a/app/src/main/java/com/saulmm/material/activities/ColorActivity.java b/app/src/main/java/com/saulmm/material/activities/ColorActivity.java index 9763a76..f7a1ec4 100644 --- a/app/src/main/java/com/saulmm/material/activities/ColorActivity.java +++ b/app/src/main/java/com/saulmm/material/activities/ColorActivity.java @@ -13,7 +13,7 @@ import android.widget.Switch; import com.saulmm.material.R; -import com.saulmm.material.utils.Utils; +import com.saulmm.material.utils.GUIUtils; public class ColorActivity extends Activity { @@ -62,7 +62,7 @@ public void onViewAttachedToWindow(View v) { getTheme().resolveAttribute(android.R.attr.colorPrimary, outValue, true); revealView.setBackgroundColor(outValue.data); - Utils.hideRevealEffect(revealView, cx, cy, 1920); + GUIUtils.hideRevealEffect(revealView, cx, cy, 1920); } @Override @@ -136,7 +136,7 @@ public void view(View view) { view.getLocationOnScreen(location); int cx = (location[0] + (view.getWidth() / 2)); - int cy = location[1] + (Utils.getStatusBarHeight(this) / 2); + int cy = location[1] + (GUIUtils.getStatusBarHeight(this) / 2); SharedPreferences.Editor ed = sharedpreferences.edit(); ed.putInt("x", cx); @@ -145,7 +145,7 @@ public void view(View view) { ed.apply(); hideNavigationStatus(); - Utils.showRevealEFfect(revealView, cx, cy, revealAnimationListener); + GUIUtils.showRevealEffect(revealView, cx, cy, revealAnimationListener); } diff --git a/app/src/main/java/com/saulmm/material/activities/DialerSampleActivity.java b/app/src/main/java/com/saulmm/material/activities/DialerSampleActivity.java index 59f151a..27a47c3 100644 --- a/app/src/main/java/com/saulmm/material/activities/DialerSampleActivity.java +++ b/app/src/main/java/com/saulmm/material/activities/DialerSampleActivity.java @@ -1,31 +1,32 @@ -/* -* Copyright 2013 The Android Open Source Project -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + package com.saulmm.material.activities; +import android.graphics.Point; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; +import android.view.Display; +import android.view.View; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.ArrayAdapter; +import android.widget.FrameLayout; +import android.widget.GridView; +import android.widget.ImageButton; import com.saulmm.material.R; -import com.saulmm.material.views.adapters.DialerPagerAdapter; +import com.saulmm.material.utils.GUIUtils; +import com.saulmm.material.views.adapters.SamplePagerAdapter; import com.saulmm.material.views.widgets.SlidingTabLayout; -public class DialerSampleActivity extends ActionBarActivity { +public class DialerSampleActivity extends ActionBarActivity implements ViewPager.OnPageChangeListener { + + private int screenWidth; + private ImageButton fabButton; + private FrameLayout dialerKeysContainer; + private float absolutefabPosition; @Override protected void onCreate(Bundle savedInstanceState) { @@ -35,6 +36,49 @@ protected void onCreate(Bundle savedInstanceState) { configureToolbar(); configurePager(); + configureFab(); + configureDialer(); + + dialerKeysContainer = (FrameLayout) findViewById(R.id.activity_dialer_frame_container); + + // Get the screen with + Display display = getWindowManager().getDefaultDisplay(); + Point size = new Point(); + display.getSize(size); + screenWidth = size.x; + } + + private void configureFab() { + + fabButton = (ImageButton) findViewById(R.id.view_fab_button); + fabButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + absolutefabPosition = v.getX(); + GUIUtils.hideViewByScale(fabButton); + dialerKeysContainer.setVisibility(View.VISIBLE); + + Animation showDialerContainerAnimation = AnimationUtils.loadAnimation(DialerSampleActivity.this, R.anim.translate_down_on); + showDialerContainerAnimation.setAnimationListener(new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) {} + + @Override + public void onAnimationEnd(Animation animation) { + + fabButton.setBackgroundResource(R.drawable.ripple_dialer_call); + fabButton.setX(screenWidth / 2 - fabButton.getWidth() / 2); + GUIUtils.showViewByScale(fabButton); + } + + @Override + public void onAnimationRepeat(Animation animation) {} + }); + + dialerKeysContainer.startAnimation(showDialerContainerAnimation); + } + }); } private void configureToolbar() { @@ -42,15 +86,79 @@ private void configureToolbar() { Toolbar mainToolbar = (Toolbar) findViewById(R.id.activity_dialer_toolbar); mainToolbar.setTitleTextColor(getResources().getColor(R.color.theme_dialer_accent)); setSupportActionBar(mainToolbar); - getSupportActionBar().setTitle("Sliding"); + getSupportActionBar().setTitle("Dialer"); } private void configurePager() { - ViewPager mViewPager = (ViewPager) findViewById(R.id.activity_dialer_pager); - mViewPager.setAdapter(new DialerPagerAdapter(this)); + ViewPager tabsViewPAger = (ViewPager) findViewById(R.id.activity_dialer_pager); + tabsViewPAger.setAdapter(new SamplePagerAdapter(this)); + tabsViewPAger.setCurrentItem(1); SlidingTabLayout mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.activity_dialer_tabs); - mSlidingTabLayout.setViewPager(mViewPager); + mSlidingTabLayout.addPagerListener(this); + mSlidingTabLayout.setViewPager(tabsViewPAger); + } + + private void configureDialer() { + + GridView dialerGrid = (GridView) findViewById(R.id.activity_dialer_pad); + dialerGrid.setAdapter(new ArrayAdapter(this, R.layout.list_item_dialer, + getResources().getStringArray(R.array.dialer_numbers))); } + + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + float fabButtonPosition = (screenWidth / 2 - fabButton.getWidth()) * positionOffset; + + + if (fabButtonPosition != 0 && position != 1) { + + absolutefabPosition = fabButtonPosition + (screenWidth/2 - fabButton.getWidth()/2); + fabButton.setX(absolutefabPosition); + } + } + + @Override + public void onBackPressed() { + + if (dialerKeysContainer.getVisibility() == View.VISIBLE) { + + Animation hideAnimation = AnimationUtils.loadAnimation(this, R.anim.translate_down_off); + hideAnimation.setAnimationListener(new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + + GUIUtils.hideViewByScale(fabButton); + } + + @Override + public void onAnimationEnd(Animation animation) { + + dialerKeysContainer.setVisibility(View.INVISIBLE); + fabButton.setBackgroundResource(R.drawable.ripple_dialer_idle); + GUIUtils.showViewByScale(fabButton); + + fabButton.setX(absolutefabPosition); + } + + @Override + public void onAnimationRepeat(Animation animation) {} + }); + + dialerKeysContainer.startAnimation(hideAnimation); + + + + } else { + super.onBackPressed(); + } + } + + @Override + public void onPageSelected(int position) {} + + @Override + public void onPageScrollStateChanged(int state) {} } diff --git a/app/src/main/java/com/saulmm/material/activities/TransitionFirstActivity.java b/app/src/main/java/com/saulmm/material/activities/TransitionFirstActivity.java index cff3eaf..26d6d4f 100644 --- a/app/src/main/java/com/saulmm/material/activities/TransitionFirstActivity.java +++ b/app/src/main/java/com/saulmm/material/activities/TransitionFirstActivity.java @@ -8,7 +8,7 @@ import android.view.View; import com.saulmm.material.R; -import com.saulmm.material.utils.Utils; +import com.saulmm.material.utils.GUIUtils; public class TransitionFirstActivity extends Activity { @@ -21,12 +21,12 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_transition_first); // Set explode animation when enter and exit the activity - Utils.configureWindowEnterExitExplodeTransition(getWindow()); + GUIUtils.configureWindowEnterExitExplodeTransition(getWindow()); // Fab Button fabButton = findViewById(R.id.fab_button); fabButton.setOnClickListener(fabClickListener); - Utils.configureFab(fabButton); + GUIUtils.configureFab(fabButton); } diff --git a/app/src/main/java/com/saulmm/material/activities/TransitionSecondActivity.java b/app/src/main/java/com/saulmm/material/activities/TransitionSecondActivity.java index 2070534..b47b520 100644 --- a/app/src/main/java/com/saulmm/material/activities/TransitionSecondActivity.java +++ b/app/src/main/java/com/saulmm/material/activities/TransitionSecondActivity.java @@ -9,7 +9,7 @@ import android.widget.LinearLayout; import com.saulmm.material.R; -import com.saulmm.material.utils.Utils; +import com.saulmm.material.utils.GUIUtils; public class TransitionSecondActivity extends Activity { @@ -25,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) { rowContainer = (LinearLayout) findViewById(R.id.row_container2); - Utils.configureWindowEnterExitExplodeTransition(getWindow()); + GUIUtils.configureWindowEnterExitExplodeTransition(getWindow()); getWindow().getEnterTransition().addListener(new Transition.TransitionListener() { @Override diff --git a/app/src/main/java/com/saulmm/material/fragments/NavigationFragment.java b/app/src/main/java/com/saulmm/material/fragments/NavigationFragment.java index afb27e5..2738c3f 100644 --- a/app/src/main/java/com/saulmm/material/fragments/NavigationFragment.java +++ b/app/src/main/java/com/saulmm/material/fragments/NavigationFragment.java @@ -12,8 +12,7 @@ public class NavigationFragment extends Fragment { @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_navigation_drawer, container, false); } diff --git a/app/src/main/java/com/saulmm/material/fragments/SamplePageFragment.java b/app/src/main/java/com/saulmm/material/fragments/SamplePageFragment.java new file mode 100644 index 0000000..5bc38e2 --- /dev/null +++ b/app/src/main/java/com/saulmm/material/fragments/SamplePageFragment.java @@ -0,0 +1,22 @@ +package com.saulmm.material.fragments; + +import android.app.Fragment; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.saulmm.material.R; + +public class SamplePageFragment extends Fragment { + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + View rootView = inflater.inflate(R.layout.fragment_dialer_sample_page, container); + + return rootView; + } +} diff --git a/app/src/main/java/com/saulmm/material/fragments/SlidingTabFragment.java b/app/src/main/java/com/saulmm/material/fragments/SlidingTabFragment.java index 87cde20..b50dd02 100644 --- a/app/src/main/java/com/saulmm/material/fragments/SlidingTabFragment.java +++ b/app/src/main/java/com/saulmm/material/fragments/SlidingTabFragment.java @@ -34,9 +34,9 @@ public class SlidingTabFragment extends Fragment { static final String LOG_TAG = "SlidingTabsBasicFragment"; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return inflater.inflate(R.layout.fragment_sliding, container, false); + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + return inflater.inflate(R.layout.fragment_dialer_sliding, container, false); } @Override diff --git a/app/src/main/java/com/saulmm/material/utils/Utils.java b/app/src/main/java/com/saulmm/material/utils/GUIUtils.java similarity index 77% rename from app/src/main/java/com/saulmm/material/utils/Utils.java rename to app/src/main/java/com/saulmm/material/utils/GUIUtils.java index ce5a781..d48da35 100644 --- a/app/src/main/java/com/saulmm/material/utils/Utils.java +++ b/app/src/main/java/com/saulmm/material/utils/GUIUtils.java @@ -10,12 +10,15 @@ import android.transition.Slide; import android.view.View; import android.view.ViewAnimationUtils; +import android.view.ViewPropertyAnimator; import android.view.Window; import android.view.animation.PathInterpolator; import com.saulmm.material.R; -public class Utils { +public class GUIUtils { + + public static final int SCALE_FACTOR = 30; public static void configureWindowEnterExitExplodeTransition(Window w) { @@ -68,7 +71,7 @@ public void onAnimationEnd(Animator animation) { anim.start(); } - public static void showRevealEFfect (final View v, int centerX, int centerY, Animator.AnimatorListener lis) { + public static void showRevealEffect(final View v, int centerX, int centerY, Animator.AnimatorListener lis) { v.setVisibility(View.VISIBLE); @@ -84,4 +87,22 @@ public static void showRevealEFfect (final View v, int centerX, int centerY, Ani } + + public static void hideViewByScale(View view) { + + ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR) + .scaleX(0).scaleY(0); + + propertyAnimator.start(); + } + + public static void showViewByScale(View view) { + + ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR) + .scaleX(1).scaleY(1); + + propertyAnimator.start(); + } + + } diff --git a/app/src/main/java/com/saulmm/material/views/adapters/DialerPagerAdapter.java b/app/src/main/java/com/saulmm/material/views/adapters/DialerPagerAdapter.java deleted file mode 100644 index d7be485..0000000 --- a/app/src/main/java/com/saulmm/material/views/adapters/DialerPagerAdapter.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.saulmm.material.views.adapters; - -import android.content.Context; -import android.support.v4.view.PagerAdapter; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import com.saulmm.material.R; - -@SuppressWarnings("FieldCanBeLocal") -public class DialerPagerAdapter extends PagerAdapter { - - private final String [] TITLES = {"SPEED DIAL", "RECENTS", "CONTACTS"}; - private Context context; - - public DialerPagerAdapter(Context context) { - this.context = context; - } - - @Override - public int getCount() { - return TITLES.length; - } - - - @Override - public boolean isViewFromObject(View view, Object o) { - return o == view; - } - - - @Override - public CharSequence getPageTitle(int position) { - return TITLES[position]; - } - - @Override - public Object instantiateItem(ViewGroup container, int position) { - - View view = LayoutInflater.from(context).inflate(R.layout.item_sliding_pager, - container, false); - - container.addView(view); - - return view; - } - - @Override - public void destroyItem(ViewGroup container, int position, Object object) { - container.removeView((View) object); - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulmm/material/views/adapters/SamplePagerAdapter.java b/app/src/main/java/com/saulmm/material/views/adapters/SamplePagerAdapter.java index 81a0345..e46a832 100644 --- a/app/src/main/java/com/saulmm/material/views/adapters/SamplePagerAdapter.java +++ b/app/src/main/java/com/saulmm/material/views/adapters/SamplePagerAdapter.java @@ -11,8 +11,8 @@ @SuppressWarnings("FieldCanBeLocal") public class SamplePagerAdapter extends PagerAdapter { - private final String [] TITLES = {"CATEGORIES", "HOME", "TOP SELLING", "TOP GAMES", "TOP GROSSING"}; - private final int FRAGMENT_COUNT = 5; + private final String [] TITLES = {"SPEED DIAL", "RECENTS", "CONTACTS"}; + private final int FRAGMENT_COUNT = 3; private Context context; public SamplePagerAdapter(Context context) { @@ -24,7 +24,6 @@ public int getCount() { return FRAGMENT_COUNT; } - @Override public boolean isViewFromObject(View view, Object o) { return o == view; @@ -39,11 +38,11 @@ public CharSequence getPageTitle(int position) { @Override public Object instantiateItem(ViewGroup container, int position) { - View view = LayoutInflater.from(context).inflate(R.layout.item_sliding_pager, - container, false); + View view = LayoutInflater.from(context).inflate( + R.layout.fragment_dialer_sample_page, + container, false); container.addView(view); - return view; } diff --git a/app/src/main/java/com/saulmm/material/views/widgets/SlidingTabLayout.java b/app/src/main/java/com/saulmm/material/views/widgets/SlidingTabLayout.java index 59ebf17..dbf48ad 100644 --- a/app/src/main/java/com/saulmm/material/views/widgets/SlidingTabLayout.java +++ b/app/src/main/java/com/saulmm/material/views/widgets/SlidingTabLayout.java @@ -31,6 +31,8 @@ import com.saulmm.material.R; +import java.util.ArrayList; + /** * To be used with ViewPager to provide a tab indicator component which give constant feedback as to * the user's scroll progress. @@ -79,6 +81,8 @@ public interface TabColorizer { private ViewPager mViewPager; private ViewPager.OnPageChangeListener mViewPagerPageChangeListener; + private ArrayList pagerListeners = new ArrayList(); + private final SlidingTabStrip mTabStrip; public SlidingTabLayout(Context context) { @@ -101,6 +105,12 @@ public SlidingTabLayout(Context context, AttributeSet attrs, int defStyle) { mTabStrip = new SlidingTabStrip(context); addView(mTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + + pagerListeners.add(new InternalViewPagerListener()); + } + + public void addPagerListener (ViewPager.OnPageChangeListener listener) { + pagerListeners.add(listener); } /** @@ -161,7 +171,29 @@ public void setViewPager(ViewPager viewPager) { mViewPager = viewPager; if (viewPager != null) { - viewPager.setOnPageChangeListener(new InternalViewPagerListener()); + viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int i, float v, int i2) { + + for (ViewPager.OnPageChangeListener pagerListener : pagerListeners) { + pagerListener.onPageScrolled(i, v, i2); + } + } + + @Override + public void onPageSelected(int i) { + for (ViewPager.OnPageChangeListener pagerListener : pagerListeners) { + pagerListener.onPageSelected(i); + } + } + + @Override + public void onPageScrollStateChanged(int i) { + for (ViewPager.OnPageChangeListener pagerListener : pagerListeners) { + pagerListener.onPageScrollStateChanged(i); + } + } + }); populateTabStrip(); } } diff --git a/app/src/main/res/anim/translate_down_off.xml b/app/src/main/res/anim/translate_down_off.xml new file mode 100644 index 0000000..79302d0 --- /dev/null +++ b/app/src/main/res/anim/translate_down_off.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/app/src/main/res/anim/translate_down_on.xml b/app/src/main/res/anim/translate_down_on.xml new file mode 100644 index 0000000..b534991 --- /dev/null +++ b/app/src/main/res/anim/translate_down_on.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ripple_dialer_call.xml b/app/src/main/res/drawable/ripple_dialer_call.xml new file mode 100644 index 0000000..87d6c96 --- /dev/null +++ b/app/src/main/res/drawable/ripple_dialer_call.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ripple_dialer_idle.xml b/app/src/main/res/drawable/ripple_dialer_idle.xml new file mode 100644 index 0000000..ead7fa8 --- /dev/null +++ b/app/src/main/res/drawable/ripple_dialer_idle.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ripple_round.xml b/app/src/main/res/drawable/ripple_round.xml index 2524a0b..ead7fa8 100644 --- a/app/src/main/res/drawable/ripple_round.xml +++ b/app/src/main/res/drawable/ripple_round.xml @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_color.xml b/app/src/main/res/layout/activity_color.xml index 823037c..774dfee 100644 --- a/app/src/main/res/layout/activity_color.xml +++ b/app/src/main/res/layout/activity_color.xml @@ -10,14 +10,15 @@ android:layout_height="match_parent" android:background="?android:colorAccent" android:elevation="5dp" - android:visibility="invisible"/> + android:visibility="invisible" + /> - + android:layout_height="?attr/actionBarSize" + /> + android:background="?android:colorPrimary" + > + android:text="Title" + /> - + tools:text="Amazing text" + /> - - + android:orientation="horizontal" + > + android:layout_gravity="center_vertical" + /> + android:background="@drawable/color1" + /> + android:background="@drawable/color2" + /> + android:background="@drawable/color3" + /> + android:background="@drawable/color4" + /> diff --git a/app/src/main/res/layout/activity_dialer.xml b/app/src/main/res/layout/activity_dialer.xml index b47297b..e595ce6 100755 --- a/app/src/main/res/layout/activity_dialer.xml +++ b/app/src/main/res/layout/activity_dialer.xml @@ -1,35 +1,36 @@ - - - + > + android:orientation="vertical" + > + + + /> + android:elevation="10dp" + /> + android:background="#ffe2e2e2" + /> - + + + + + + + + + diff --git a/app/src/main/res/layout/item_sliding_pager.xml b/app/src/main/res/layout/fragment_dialer_sample_page.xml similarity index 55% rename from app/src/main/res/layout/item_sliding_pager.xml rename to app/src/main/res/layout/fragment_dialer_sample_page.xml index 3c39efb..238367c 100644 --- a/app/src/main/res/layout/item_sliding_pager.xml +++ b/app/src/main/res/layout/fragment_dialer_sample_page.xml @@ -1,17 +1,18 @@ - + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center" + > + android:elevation="10dp" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_sliding.xml b/app/src/main/res/layout/fragment_dialer_sliding.xml similarity index 80% rename from app/src/main/res/layout/fragment_sliding.xml rename to app/src/main/res/layout/fragment_dialer_sliding.xml index d0af048..e38448a 100644 --- a/app/src/main/res/layout/fragment_sliding.xml +++ b/app/src/main/res/layout/fragment_dialer_sliding.xml @@ -3,19 +3,22 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFF" - android:orientation="vertical"> + android:orientation="vertical" + > + android:elevation="10dp" + /> + android:elevation="10dp" + /> + android:background="@android:color/white" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/list_item_dialer.xml b/app/src/main/res/layout/list_item_dialer.xml new file mode 100644 index 0000000..bcf13aa --- /dev/null +++ b/app/src/main/res/layout/list_item_dialer.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/view_fab_button.xml b/app/src/main/res/layout/view_fab_button.xml index 82daf4a..7b21d56 100644 --- a/app/src/main/res/layout/view_fab_button.xml +++ b/app/src/main/res/layout/view_fab_button.xml @@ -2,15 +2,15 @@ diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 716973a..b9bf844 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -6,6 +6,7 @@ @color/theme_dialer_primary @color/theme_dialer_high @color/theme_dialer_accent + @color/theme_dialer_primary true diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d9115c2..409abcc 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -10,10 +10,12 @@ + #00C853 #0277BD #0288D1 #FFF + #4fc3f7 #009688 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d00d5e2..746b056 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,15 +5,25 @@ Settings MyActivity2 Example action - Hello world! NavDrawerActivity - Section 1 - Section 2 - Section 3 - Open navigation drawer - Close navigation drawer - Drawer Open - Drawer Closed ColorActivity + Open + Close + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + * + 0 + # +