summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-04-30 19:09:31 +0200
committerParménides GV <parmegv@sdf.org>2015-04-30 19:09:31 +0200
commit436de7afeea2cd234db8a4b70ace396101126e88 (patch)
tree18671f6716133ca2dc2a059b82ad86d45d555fa5 /app
parent237e51e09ea7ae13c4cdf7fd9247447f6d75fb9a (diff)
Better layout, xlarge adaptation too.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java9
-rw-r--r--app/src/main/res/layout-xlarge/fragment_user_session.xml55
-rw-r--r--app/src/main/res/layout/fragment_user_session.xml29
3 files changed, 70 insertions, 23 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java
index 0766dbd5..f0f4a8fa 100644
--- a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java
@@ -61,15 +61,6 @@ public class UserStatusFragment extends Fragment implements Observer, SessionDia
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- Fragment fragment = (getFragmentManager().findFragmentById(R.id.user_status_fragment));
- FragmentTransaction ft = getActivity().getFragmentManager().beginTransaction();
- ft.remove(fragment);
- ft.commit();
- }
-
- @Override
public void onAttach(Activity activity) {
super.onAttach(activity);
dashboard = (Dashboard) activity;
diff --git a/app/src/main/res/layout-xlarge/fragment_user_session.xml b/app/src/main/res/layout-xlarge/fragment_user_session.xml
new file mode 100644
index 00000000..30969219
--- /dev/null
+++ b/app/src/main/res/layout-xlarge/fragment_user_session.xml
@@ -0,0 +1,55 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="30dp"
+ android:layout_marginLeft="60dp"
+ android:layout_marginStart="60dp"
+ android:orientation="vertical"
+ tools:context="se.leap.bitmaskclient.userstatus.UserStatusFragment">
+
+ <TextView
+ android:id="@+id/user.status.username"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="30dp"
+ android:layout_marginRight="60dp"
+ android:layout_marginEnd="60dp"
+ android:layout_gravity="center"
+ android:textSize="46sp"
+ android:text="@string/default_username"
+ android:textAppearance="?android:attr/textAppearanceMedium"/>
+
+ <LinearLayout
+ android:id="@+id/user.status.buttonAndIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center">
+
+ <Button
+ android:id="@+id/user.status.button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="24sp"
+ />
+
+ <view
+ android:id="@+id/user.status.icon"
+ android:layout_width="56dp"
+ android:layout_height="56dp"
+ android:layout_marginLeft="26dp"
+ android:layout_marginStart="26dp"
+ android:background="@android:color/transparent"
+ android:color="@android:color/holo_blue_dark"
+ class="mbanje.kurt.fabbutton.FabButton"
+ android:layout_gravity="center"
+ android:visibility="visible"
+ android:indeterminate="true"
+ android:max="100"
+ fbb_autoStart="true"
+ fbb_progressColor="#ff170aff"
+ fbb_progressWidthRatio="0.3"
+ />
+
+ </LinearLayout>
+</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_user_session.xml b/app/src/main/res/layout/fragment_user_session.xml
index 81e68199..5194e495 100644
--- a/app/src/main/res/layout/fragment_user_session.xml
+++ b/app/src/main/res/layout/fragment_user_session.xml
@@ -1,41 +1,42 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
+ android:layout_marginLeft="20dp"
+ android:layout_marginStart="20dp"
tools:context="se.leap.bitmaskclient.userstatus.UserStatusFragment">
<TextView
android:id="@+id/user.status.username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="10dp"
- android:layout_marginStart="10dp"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="6dp"
- android:layout_centerHorizontal="true"
+ android:layout_marginBottom="10dp"
+ android:layout_marginRight="20dp"
+ android:layout_marginEnd="20dp"
+ android:textSize="20sp"
android:text="@string/default_username"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"/>
<LinearLayout
+ android:id="@+id/user.status.buttonAndIcon"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/user.status.username"
- android:layout_centerInParent="true">
+ android:layout_height="wrap_content">
<Button
android:id="@+id/user.status.button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:textSize="14sp"
/>
<view
android:id="@+id/user.status.icon"
android:layout_width="32dp"
android:layout_height="32dp"
- android:layout_marginLeft="3dp"
- android:layout_marginStart="3dp"
+ android:layout_marginLeft="9dp"
+ android:layout_marginStart="9dp"
+ android:background="@android:color/transparent"
android:color="@android:color/holo_blue_dark"
class="mbanje.kurt.fabbutton.FabButton"
android:layout_gravity="center"
@@ -48,4 +49,4 @@
/>
</LinearLayout>
-</RelativeLayout>
+</LinearLayout>