Browse Source

Before adding intermediate screen to splash

master
Preyea Regmi 5 years ago
parent
commit
773d2e6b48
  1. 21
      app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java
  2. 59
      app/src/main/res/layout/activity_splash_screen_key_1.xml
  3. 47
      app/src/main/res/layout/activity_splash_screen_key_2.xml

21
app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java

@ -19,11 +19,9 @@ import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; import android.support.v4.view.ViewPropertyAnimatorListenerAdapter;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager; import android.support.v7.widget.StaggeredGridLayoutManager;
import android.text.Html; import android.text.Html;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateDecelerateInterpolator;
@ -145,6 +143,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
} }
private void performDefaultAction(Bundle savedInstanceState) { private void performDefaultAction(Bundle savedInstanceState) {
if (savedInstanceState == null) { if (savedInstanceState == null) {
languageViewTransitionManager.underlineTitleText(true); languageViewTransitionManager.underlineTitleText(true);
@ -170,18 +169,15 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
// view_pager.setOffscreenPageLimit(3); // view_pager.setOffscreenPageLimit(3);
} }
private void initLanguageRV()
{
private void initLanguageRV() {
languageSelectionRVAdapter = new LanguageSelectionRVAdapter(); languageSelectionRVAdapter = new LanguageSelectionRVAdapter();
languageSelectionRVAdapter.setLanguageSelectionListener(this); languageSelectionRVAdapter.setLanguageSelectionListener(this);
languageRv.setAdapter(languageSelectionRVAdapter); languageRv.setAdapter(languageSelectionRVAdapter);
} }
private void initPayoutModeRV()
{
private void initPayoutModeRV() {
SelectedRedBorderDecoration selectedRedBorderDecoration = new SelectedRedBorderDecoration(this); SelectedRedBorderDecoration selectedRedBorderDecoration = new SelectedRedBorderDecoration(this);
paymentModeRV.addItemDecoration(selectedRedBorderDecoration); paymentModeRV.addItemDecoration(selectedRedBorderDecoration);
paymentModeRV.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)); paymentModeRV.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
@ -350,19 +346,25 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
private Interpolator accelerateDecelerateInterpolator; private Interpolator accelerateDecelerateInterpolator;
private boolean userNavigatedToLanguageView; private boolean userNavigatedToLanguageView;
private int textViewPaintFlags; private int textViewPaintFlags;
private ConstraintSet initialSet;
private boolean notCalculatedInitialConstraint;
LanguageViewTransitionManager(Context context) { LanguageViewTransitionManager(Context context) {
isAnimationOnProgress = false; isAnimationOnProgress = false;
this.context = context; this.context = context;
constraintSet = new ConstraintSet(); constraintSet = new ConstraintSet();
initialSet=new ConstraintSet();
initialSet.clone(rootLayout);
anticipateOvershootInterpolator = new AnticipateOvershootInterpolator(.8f); anticipateOvershootInterpolator = new AnticipateOvershootInterpolator(.8f);
overshootInterpolator = new OvershootInterpolator(); overshootInterpolator = new OvershootInterpolator();
accelerateDecelerateInterpolator = new AccelerateDecelerateInterpolator(); accelerateDecelerateInterpolator = new AccelerateDecelerateInterpolator();
textViewPaintFlags = selectedLanguageText.getPaintFlags(); textViewPaintFlags = selectedLanguageText.getPaintFlags();
notCalculatedInitialConstraint = true;
} }
void showLanguageView(Runnable onAnimationCompleteCallback) { void showLanguageView(Runnable onAnimationCompleteCallback) {
hideKeyBoard();
constraintSet.clone(context, R.layout.activity_splash_screen_key_2); constraintSet.clone(context, R.layout.activity_splash_screen_key_2);
ChangeBounds transition = new ChangeBounds(); ChangeBounds transition = new ChangeBounds();
transition.setPathMotion(new ArcMotion()); transition.setPathMotion(new ArcMotion());
@ -413,9 +415,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
} }
void hideLanguage(Runnable onAnimationCompleteCallback) { void hideLanguage(Runnable onAnimationCompleteCallback) {
constraintSet.clone(context, R.layout.activity_splash_screen_key_1);
ChangeBounds transition = new ChangeBounds(); ChangeBounds transition = new ChangeBounds();
transition.setPathMotion(new ArcMotion()); transition.setPathMotion(new ArcMotion());
transition.setInterpolator(overshootInterpolator); transition.setInterpolator(overshootInterpolator);
@ -456,7 +455,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener,
} }
}); });
TransitionManager.beginDelayedTransition(rootLayout, transition); TransitionManager.beginDelayedTransition(rootLayout, transition);
constraintSet.applyTo(rootLayout);
initialSet.applyTo(rootLayout);
} }
public boolean isAnimationRunning() { public boolean isAnimationRunning() {

59
app/src/main/res/layout/activity_splash_screen_key_1.xml

@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootLayout" android:id="@+id/rootLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"> android:background="@color/colorPrimary">
<ImageView <ImageView
@ -55,7 +62,7 @@
android:paddingBottom="@dimen/_10sdp" android:paddingBottom="@dimen/_10sdp"
android:text="@string/select_language_text" android:text="@string/select_language_text"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_14ssp"
android:textSize="@dimen/_15ssp"
app:layout_constraintBottom_toBottomOf="@+id/selectedLanguageIcon" app:layout_constraintBottom_toBottomOf="@+id/selectedLanguageIcon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/selectedLanguageIcon" app:layout_constraintStart_toEndOf="@id/selectedLanguageIcon"
@ -82,14 +89,14 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/view_pager" android:id="@+id/view_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_margin="@dimen/_8sdp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/_8sdp"
android:background="@drawable/curve_rectangle_bright_grey" android:background="@drawable/curve_rectangle_bright_grey"
android:padding="@dimen/_10sdp" android:padding="@dimen/_10sdp"
app:layout_constraintBottom_toTopOf="@+id/btn_login" app:layout_constraintBottom_toTopOf="@+id/btn_login"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
>
app:layout_constraintTop_toBottomOf="@id/selectedLanguageText">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
@ -378,54 +385,46 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton <com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
android:id="@+id/btn_login" android:id="@+id/btn_login"
android:layout_width="0dp"
android:layout_width="182dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/ic_blue_button_with_white_border" android:background="@drawable/ic_blue_button_with_white_border"
android:text="@string/login_text" android:text="@string/login_text"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_11ssp" android:textSize="@dimen/_11ssp"
app:layout_constraintBottom_toTopOf="@+id/appVersionTxtView"
app:layout_constraintEnd_toEndOf="@+id/btn_new_user"
app:layout_constraintEnd_toStartOf="@+id/btn_new_user"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/languageRv"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_pager" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton <com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
android:id="@+id/btn_new_user" android:id="@+id/btn_new_user"
android:layout_width="0dp"
android:layout_width="182dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/ic_red_button_with_white_border" android:background="@drawable/ic_red_button_with_white_border"
android:text="@string/new_user_text" android:text="@string/new_user_text"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_11ssp" android:textSize="@dimen/_11ssp"
app:layout_constraintBottom_toTopOf="@+id/appVersionTxtView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_login" />
app:layout_constraintEnd_toEndOf="@+id/btn_login"
app:layout_constraintStart_toStartOf="@+id/btn_login"
app:layout_constraintTop_toBottomOf="@+id/btn_login" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/appVersionTxtView" android:id="@+id/appVersionTxtView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
tools:text=" 2.2.3 "
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginEnd="@dimen/_8sdp"
android:layout_marginBottom="@dimen/_5sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginTop="8dp"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_10ssp" android:textSize="@dimen/_10ssp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintEnd_toEndOf="@+id/btn_new_user"
app:layout_constraintStart_toStartOf="@+id/btn_new_user"
app:layout_constraintTop_toBottomOf="@+id/btn_new_user"
tools:text=" 2.2.3 " />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</ScrollView>

47
app/src/main/res/layout/activity_splash_screen_key_2.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootLayout" android:id="@+id/rootLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -22,8 +23,8 @@
<ImageView <ImageView
android:id="@+id/imageView2" android:id="@+id/imageView2"
android:layout_width="@dimen/_166sdp"
android:layout_height="wrap_content"
android:layout_width="@dimen/_100sdp"
android:layout_height="@dimen/_30sdp"
android:layout_marginEnd="@dimen/_8sdp" android:layout_marginEnd="@dimen/_8sdp"
android:layout_marginStart="@dimen/_8sdp" android:layout_marginStart="@dimen/_8sdp"
android:layout_marginTop="@dimen/_32sdp" android:layout_marginTop="@dimen/_32sdp"
@ -69,7 +70,7 @@
android:layout_marginStart="@dimen/_12sdp" android:layout_marginStart="@dimen/_12sdp"
android:text="@string/select_language_text" android:text="@string/select_language_text"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_16ssp"
android:textSize="@dimen/_15ssp"
app:layout_constraintBottom_toBottomOf="@+id/selectedLanguageIcon" app:layout_constraintBottom_toBottomOf="@+id/selectedLanguageIcon"
app:layout_constraintStart_toEndOf="@id/selectedLanguageIcon" app:layout_constraintStart_toEndOf="@id/selectedLanguageIcon"
app:layout_constraintTop_toTopOf="@+id/selectedLanguageIcon" app:layout_constraintTop_toTopOf="@+id/selectedLanguageIcon"
@ -97,53 +98,45 @@
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton <com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
android:id="@+id/btn_login" android:id="@+id/btn_login"
android:layout_width="0dp"
android:layout_width="182dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/ic_blue_button_with_white_border" android:background="@drawable/ic_blue_button_with_white_border"
android:text="@string/login_text" android:text="@string/login_text"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_11ssp" android:textSize="@dimen/_11ssp"
app:layout_constraintEnd_toEndOf="@+id/btn_new_user"
app:layout_constraintEnd_toStartOf="@+id/btn_new_user"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/languageRv"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton <com.gmeremit.online.gmeremittance_native.customwidgets.GmeButton
android:id="@+id/btn_new_user" android:id="@+id/btn_new_user"
android:layout_width="0dp"
android:layout_width="182dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/ic_red_button_with_white_border" android:background="@drawable/ic_red_button_with_white_border"
android:text="@string/new_user_text" android:text="@string/new_user_text"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_11ssp" android:textSize="@dimen/_11ssp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_login" />
app:layout_constraintEnd_toEndOf="@+id/btn_login"
app:layout_constraintStart_toStartOf="@+id/btn_login"
app:layout_constraintTop_toBottomOf="@+id/btn_login" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/appVersionTxtView" android:id="@+id/appVersionTxtView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginEnd="@dimen/_8sdp"
android:layout_marginBottom="@dimen/_8sdp"
android:layout_marginTop="8dp"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/_10ssp" android:textSize="@dimen/_10ssp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"
android:text="App Version 1.1" />
app:layout_constraintEnd_toEndOf="@+id/btn_new_user"
app:layout_constraintStart_toStartOf="@+id/btn_new_user"
app:layout_constraintTop_toBottomOf="@+id/btn_new_user"
tools:text=" 2.2.3 " />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
Loading…
Cancel
Save