Implement settings screen redesign
parent
1616e841da
commit
c76335150c
@ -0,0 +1,240 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp"
|
||||||
|
android:viewportWidth="25"
|
||||||
|
android:viewportHeight="25">
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M7.81,7.81H1.56V1.56h6.25V7.81zM9.38,0H0v9.38h9.38V0z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-5,-5h19.38v19.38h-19.38z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M3.12,3.12h3.12v3.12h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-1.88,-1.88h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M1.56,17.19h6.25v6.25H1.56V17.19zM0,25h9.38v-9.38H0V25z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-5,10.62h19.38v19.38h-19.38z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M3.12,18.75h3.12v3.12h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-1.88,13.75h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M23.44,7.81h-6.25V1.56h6.25V7.81zM15.62,0v9.38H25V0H15.62z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M10.62,-5h19.38v19.38h-19.38z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M18.75,3.12h3.12v3.12h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M13.75,-1.88h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M3.12,10.94l-3.12,0l0,3.12l4.69,0l0,-1.56l-1.57,0z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-5,5.94h14.69v13.12h-14.69z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M10.94,14.06h3.12v3.12h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M5.94,9.06h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M4.69,10.94h3.12v1.56h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M-0.31,5.94h13.12v11.56h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M14.06,18.75l-3.12,0l0,1.56l1.56,0l0,1.57l1.56,0l0,-1.57z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M5.94,13.75h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M9.38,10.94l0,1.56l-1.57,0l0,1.56l3.13,0l0,-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M2.81,5.94h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M12.5,6.25h1.56v3.12h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M7.5,1.25h11.56v13.12h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M14.06,12.5l0,1.56l3.13,0l0,-3.12l-4.69,0l0,1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M7.5,5.94h14.69v13.12h-14.69z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M10.94,9.38h1.56v1.56h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M5.94,4.38h11.56v11.56h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M14.06,21.88h3.12v3.12h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M9.06,16.88h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M10.94,21.88h1.56v3.12h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M5.94,16.88h11.56v13.12h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M14.06,17.19h1.56v1.56h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M9.06,12.19h11.56v11.56h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M14.06,4.69l0,-3.13l-1.56,0l0,-1.56l-1.56,0l0,6.25l1.56,0l0,-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M5.94,-5h13.12v16.25h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M18.75,21.88h1.56v3.12h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M13.75,16.88h11.56v13.12h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M18.75,18.75h3.12v1.56h-3.12z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M13.75,13.75h13.12v11.56h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M17.19,20.31h1.56v1.56h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12.19,15.31h11.56v11.56h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M15.62,18.75h1.56v1.56h-1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M10.62,13.75h11.56v11.56h-11.56z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M21.88,15.62l0,1.57l1.56,0l0,1.56l1.56,0l0,-3.13l-1.56,0z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M16.88,10.62h13.12v13.12h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M23.44,20.31l-1.56,0l0,4.69l3.12,0l0,-3.12l-1.56,0z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M16.88,15.31h13.12v14.69h-13.12z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M15.62,15.62l0,1.57l4.69,0l0,-3.13l-3.12,0l0,1.56z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M10.62,9.06h14.69v13.12h-14.69z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M18.75,10.94l0,1.56l3.13,0l0,1.56l3.12,0l0,-3.12l-3.12,0z M 0,0"/>
|
||||||
|
<group>
|
||||||
|
<clip-path android:pathData="M-335,-28h375v908h-375z M 0,0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M13.75,5.94h16.25v13.12h-16.25z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</vector>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@color/unimportant" />
|
||||||
|
|
||||||
|
<corners android:radius="38dp" />
|
||||||
|
|
||||||
|
<stroke android:width="@dimen/profile_picture_border_thickness" android:color="@color/border" />
|
||||||
|
</shape>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
|
||||||
|
<corners android:radius="38dp" />
|
||||||
|
|
||||||
|
<stroke android:width="@dimen/profile_picture_border_thickness" android:color="@color/border" />
|
||||||
|
</shape>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/cell_selected">
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<color android:color="@color/cell_background" />
|
||||||
|
</item>
|
||||||
|
</ripple>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
|
||||||
|
<corners android:radius="24dp" />
|
||||||
|
|
||||||
|
<stroke android:width="@dimen/border_thickness" android:color="@color/text" />
|
||||||
|
</shape>
|
@ -0,0 +1,169 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/default_session_background"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.loki.redesign.views.ProfilePictureView
|
||||||
|
android:id="@+id/profilePictureView"
|
||||||
|
android:layout_width="@dimen/large_profile_picture_size"
|
||||||
|
android:layout_height="@dimen/large_profile_picture_size"
|
||||||
|
android:layout_marginTop="@dimen/large_spacing" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/displayNameTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/large_spacing"
|
||||||
|
android:layout_marginTop="@dimen/small_spacing"
|
||||||
|
android:layout_marginRight="@dimen/large_spacing"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/very_large_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.loki.redesign.views.SeparatorView
|
||||||
|
android:id="@+id/separatorView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginLeft="@dimen/large_spacing"
|
||||||
|
android:layout_marginTop="@dimen/large_spacing"
|
||||||
|
android:layout_marginRight="@dimen/large_spacing"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/publicKeyTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/large_spacing"
|
||||||
|
android:layout_marginTop="@dimen/large_spacing"
|
||||||
|
android:layout_marginRight="@dimen/large_spacing"
|
||||||
|
android:textSize="@dimen/large_font_size"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:fontFamily="@font/space_mono_regular"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:text="05987d601943c267879be41830888066c6a024cbdc9a548d06813924bf3372ea78" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/large_spacing"
|
||||||
|
android:layout_marginTop="@dimen/large_spacing"
|
||||||
|
android:layout_marginRight="@dimen/large_spacing"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style="@style/MediumProminentOutlineButton"
|
||||||
|
android:id="@+id/copyButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/medium_button_height"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="Copy" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style="@style/MediumUnimportantOutlineButton"
|
||||||
|
android:id="@+id/shareButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/medium_button_height"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="@dimen/medium_spacing"
|
||||||
|
android:text="Share" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:layout_marginTop="@dimen/large_spacing"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/privacyButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Privacy" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notificationsButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Notifications" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/linkedDevicesButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Linked Devices" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/seedButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Show Seed" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/clearAllDataButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/destructive"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Clear All Data" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:layout_marginBottom="@dimen/large_spacing"
|
||||||
|
android:background="@color/separator" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/showQRCodeItem"
|
||||||
|
android:title="Show QR Code"
|
||||||
|
android:icon="@drawable/ic_qr_code"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
|
||||||
|
</menu>
|
@ -0,0 +1,88 @@
|
|||||||
|
package org.thoughtcrime.securesms.loki.redesign.activities
|
||||||
|
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.ClipboardManager
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.MenuItem
|
||||||
|
import android.widget.Toast
|
||||||
|
import kotlinx.android.synthetic.main.activity_settings.*
|
||||||
|
import network.loki.messenger.R
|
||||||
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||||
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
|
import org.thoughtcrime.securesms.mms.GlideApp
|
||||||
|
import org.thoughtcrime.securesms.mms.GlideRequests
|
||||||
|
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||||
|
|
||||||
|
class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
||||||
|
private lateinit var glide: GlideRequests
|
||||||
|
|
||||||
|
private val hexEncodedPublicKey: String
|
||||||
|
get() {
|
||||||
|
val masterHexEncodedPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(this)
|
||||||
|
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(this)
|
||||||
|
return masterHexEncodedPublicKey ?: userHexEncodedPublicKey
|
||||||
|
}
|
||||||
|
|
||||||
|
// region Lifecycle
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
|
||||||
|
super.onCreate(savedInstanceState, isReady)
|
||||||
|
// Set content view
|
||||||
|
setContentView(R.layout.activity_settings)
|
||||||
|
// Set title
|
||||||
|
supportActionBar!!.title = "Settings"
|
||||||
|
// Set up Glide
|
||||||
|
glide = GlideApp.with(this)
|
||||||
|
// Set up profile picture view
|
||||||
|
profilePictureView.glide = glide
|
||||||
|
profilePictureView.hexEncodedPublicKey = hexEncodedPublicKey
|
||||||
|
profilePictureView.isLarge = true
|
||||||
|
profilePictureView.update()
|
||||||
|
// Set up display name text view
|
||||||
|
displayNameTextView.text = DatabaseFactory.getLokiUserDatabase(this).getDisplayName(hexEncodedPublicKey)
|
||||||
|
// Set up public key text view
|
||||||
|
publicKeyTextView.text = hexEncodedPublicKey
|
||||||
|
// Set up copy button
|
||||||
|
copyButton.setOnClickListener { copyPublicKey() }
|
||||||
|
// Set up share button
|
||||||
|
shareButton.setOnClickListener { sharePublicKey() }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||||
|
menuInflater.inflate(R.menu.menu_settings, menu)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Interaction
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
val id = item.itemId
|
||||||
|
when (id) {
|
||||||
|
R.id.showQRCodeItem -> showQRCode()
|
||||||
|
else -> { /* Do nothing */ }
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showQRCode() {
|
||||||
|
// TODO: Implement
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun copyPublicKey() {
|
||||||
|
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
val clip = ClipData.newPlainText("Session ID", hexEncodedPublicKey)
|
||||||
|
clipboard.primaryClip = clip
|
||||||
|
Toast.makeText(this, R.string.activity_register_public_key_copied_message, Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun sharePublicKey() {
|
||||||
|
val intent = Intent()
|
||||||
|
intent.action = Intent.ACTION_SEND
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, hexEncodedPublicKey)
|
||||||
|
intent.type = "text/plain"
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
}
|
Loading…
Reference in New Issue