Add a footer to the SettingsFragment, which contains the app logo, the app name, version name and the Connection status icon.

This commit is contained in:
Severiano Jaramillo 2018-12-21 18:40:35 -06:00
parent 80b5f9f571
commit ae8a2f17e3
2 changed files with 113 additions and 67 deletions

View file

@ -12,6 +12,7 @@ import android.widget.Toast
import androidx.fragment.app.Fragment
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.customview.customView
import cy.agorise.bitsybitshareswallet.BuildConfig
import cy.agorise.bitsybitshareswallet.R
import cy.agorise.bitsybitshareswallet.repositories.AuthorityRepository
import cy.agorise.bitsybitshareswallet.utils.Constants
@ -44,6 +45,8 @@ class SettingsFragment : Fragment() {
initNightModeSwitch()
btnViewBrainKey.setOnClickListener { getBrainkey(it) }
tvFooterAppVersion.text = String.format("%s v%s", getString(R.string.app_name), BuildConfig.VERSION_NAME)
}
/**

View file

@ -5,11 +5,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".fragments.SettingsFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingStart="@dimen/activity_horizontal_margin"
android:paddingEnd="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="32dp"
tools:context=".fragments.SettingsFragment">
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
@ -77,4 +87,37 @@
android:text="@string/msg__bugs_or_ideas"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/lightGray">
<ImageView
android:id="@+id/ivFooterAppLogo"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="4dp"
android:padding="4dp"
android:src="@drawable/ic_bitsy_logo"/>
<TextView
android:id="@+id/tvFooterAppVersion"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginStart="8dp"
android:gravity="center"
android:layout_toEndOf="@+id/ivFooterAppLogo"
tools:text="BiTSy v2.0"
android:textColor="@android:color/secondary_text_light"/>
<ImageView
android:id="@+id/ivConnectionStatusIcon"
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="4dp"
android:src="@drawable/ic_disconnected"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>