Skip to content

Commit

Permalink
fix splash style
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Jul 19, 2020
1 parent 7ed2c5b commit 4c765e4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class SplashScreenActivity extends BaseStatusActivity {
CardView privacyPolicyCardView;
@BindView(R.id.splash_screen_privacy_policy_card)
CardView termsOfUseCardView;
@BindView(R.id.splash_screen_version)
TextView versionTextView;

String AGREEMENT_VERSION_PREFERENCE = "AGREEMENT_VERSION_PREFERENCE";

Expand Down Expand Up @@ -173,6 +175,7 @@ private void renderPage(){
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
String agreedVersion = prefs.getString(AGREEMENT_VERSION_PREFERENCE,"");
String currentVersion = getVersionName();
versionTextView.setText(getString(R.string.app_version_template,currentVersion));
agreeToContinueBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
33 changes: 22 additions & 11 deletions app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,24 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/app_use_agreement_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/splash_screen_textview" />
app:layout_constraintTop_toBottomOf="@+id/splash_screen_version" />

<TextView
android:id="@+id/splash_screen_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/colorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/splash_screen_textview"
tools:text="@string/app_version_template" />

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -57,17 +69,16 @@
android:id="@+id/splash_screen_terms_of_use_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:clickable="true"
android:foreground="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground"
app:cardUseCompatPadding="true">

<TextView
android:id="@+id/splash_screen_terms_of_use_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:padding="8dp"
android:text="@string/app_terms_of_use"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</androidx.cardview.widget.CardView>
Expand All @@ -78,15 +89,15 @@
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:clickable="true"
android:foreground="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground"
app:cardUseCompatPadding="true">

<TextView
android:id="@+id/splash_screen_privacy_policy_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:padding="8dp"
android:text="@string/app_privacy_policy"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</androidx.cardview.widget.CardView>
Expand Down

0 comments on commit 4c765e4

Please sign in to comment.