some Optimizations for tablets (#647)

* show ComposeActivity as Dialog on tablets

* limit timeline width on large devices

* limit width on large devices for thread view and search

* increase media preview size on large devices
main
Konrad Pozniak 7 years ago committed by GitHub
parent 42b13caffc
commit 6584ffc41d
  1. 7
      app/src/main/AndroidManifest.xml
  2. 5
      app/src/main/res/drawable-night/background_dialog_activity.xml
  3. 5
      app/src/main/res/drawable/background_dialog_activity.xml
  4. 20
      app/src/main/res/layout-w640dp/fragment_timeline.xml
  5. 21
      app/src/main/res/layout-w640dp/fragment_view_thread.xml
  6. 6
      app/src/main/res/layout/activity_compose.xml
  7. 13
      app/src/main/res/layout/fragment_search.xml
  8. 6
      app/src/main/res/values-large/dimens.xml
  9. 12
      app/src/main/res/values-large/styles.xml
  10. 2
      app/src/main/res/values-night-v27/styles.xml
  11. 5
      app/src/main/res/values-night/styles.xml
  12. 2
      app/src/main/res/values-v27/styles.xml
  13. 3
      app/src/main/res/values-w640dp/dimens.xml
  14. 4
      app/src/main/res/values/colors.xml
  15. 4
      app/src/main/res/values/dimens.xml
  16. 5
      app/src/main/res/values/styles.xml

@ -15,7 +15,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:name=".TuskyApplication" android:name=".TuskyApplication"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/TuskyTheme">
<activity <activity
android:name=".SplashActivity" android:name=".SplashActivity"
@ -49,6 +49,7 @@
</activity> </activity>
<activity <activity
android:name=".ComposeActivity" android:name=".ComposeActivity"
android:theme="@style/TuskyDialogActivityTheme"
android:windowSoftInputMode="stateVisible|adjustResize"> android:windowSoftInputMode="stateVisible|adjustResize">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
@ -68,14 +69,14 @@
</activity> </activity>
<activity <activity
android:name=".ViewVideoActivity" android:name=".ViewVideoActivity"
android:theme="@style/AppThemeBase" android:theme="@style/TuskyBaseTheme"
android:configChanges="orientation|keyboardHidden|screenSize" /> android:configChanges="orientation|keyboardHidden|screenSize" />
<activity <activity
android:name=".ViewThreadActivity" android:name=".ViewThreadActivity"
android:configChanges="orientation|screenSize" /> android:configChanges="orientation|screenSize" />
<activity android:name=".ViewTagActivity" /> <activity android:name=".ViewTagActivity" />
<activity android:name=".ViewMediaActivity" <activity android:name=".ViewMediaActivity"
android:theme="@style/AppThemeBase" /> android:theme="@style/TuskyBaseTheme" />
<activity android:name=".AccountActivity" /> <activity android:name=".AccountActivity" />
<activity android:name=".EditProfileActivity" /> <activity android:name=".EditProfileActivity" />
<activity android:name=".PreferencesActivity" /> <activity android:name=".PreferencesActivity" />

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="@color/window_background_dark" />
</shape>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<solid android:color="@color/window_background_light" />
</shape>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/tab_page_margin_drawable">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="640dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="?attr/window_background">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/tab_page_margin_drawable">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="640dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="?attr/window_background">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

@ -25,7 +25,7 @@
<android.support.v4.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="@dimen/compose_activity_scrollview_height"
android:layout_marginBottom="52dp" android:layout_marginBottom="52dp"
android:layout_marginTop="?attr/actionBarSize"> android:layout_marginTop="?attr/actionBarSize">
@ -257,8 +257,8 @@
<ImageButton <ImageButton
android:id="@+id/composeEmojiButton" android:id="@+id/composeEmojiButton"
style="?attr/image_button_style" style="?attr/image_button_style"
android:layout_width="40dp" android:layout_width="36dp"
android:layout_height="40dp" android:layout_height="36dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:contentDescription="@string/action_emoji_keyboard" android:contentDescription="@string/action_emoji_keyboard"
android:padding="4dp" android:padding="4dp"

@ -2,13 +2,21 @@
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="?attr/tab_page_margin_drawable">
<FrameLayout
android:layout_width="@dimen/timeline_width"
android:layout_height="match_parent"
android:layout_gravity="center">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/searchRecyclerView" android:id="@+id/searchRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:listitem="@layout/item_account" /> android:layout_gravity="center"
tools:listitem="@layout/item_account"
android:background="?attr/window_background" />
<ProgressBar <ProgressBar
android:id="@+id/searchProgressBar" android:id="@+id/searchProgressBar"
@ -25,5 +33,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/search_no_results" android:text="@string/search_no_results"
android:visibility="gone" /> android:visibility="gone" />
</FrameLayout>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

@ -0,0 +1,6 @@
<resources>
<dimen name="compose_activity_scrollview_height">400dp</dimen>
<dimen name="status_media_preview_height">160dp</dimen>
<dimen name="status_detail_media_preview_height">180dp</dimen>
</resources>

@ -0,0 +1,12 @@
<resources>
<style name="TuskyDialogActivityTheme" parent="@style/TuskyTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@drawable/background_dialog_activity</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:windowCloseOnTouchOutside">false</item>
<item name="android:windowActionModeOverlay">true</item>
</style>
</resources>

@ -1,7 +1,7 @@
<resources> <resources>
<!--Dark Application Theme Styles--> <!--Dark Application Theme Styles-->
<style name="AppTheme" parent="AppThemeBase"> <style name="TuskyTheme" parent="TuskyBaseTheme">
<item name="android:windowLightNavigationBar">false</item> <item name="android:windowLightNavigationBar">false</item>
<item name="android:navigationBarColor">@color/window_background_dark</item> <item name="android:navigationBarColor">@color/window_background_dark</item>
<item name="android:navigationBarDividerColor">@color/status_divider_dark</item> <item name="android:navigationBarDividerColor">@color/status_divider_dark</item>

@ -1,7 +1,8 @@
<resources> <resources>
<!--Dark Application Theme Styles--> <!--Dark Application Theme Styles-->
<style name="AppTheme" parent="AppThemeBase"/> <style name="TuskyTheme" parent="TuskyBaseTheme"/>
<style name="AppThemeBase" parent="Theme.AppCompat.NoActionBar"> <style name="TuskyDialogActivityTheme" parent="@style/TuskyTheme" />
<style name="TuskyBaseTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/color_primary_dark</item> <item name="colorPrimary">@color/color_primary_dark</item>
<item name="colorPrimaryDark">@color/color_primary_dark_dark</item> <item name="colorPrimaryDark">@color/color_primary_dark_dark</item>
<item name="colorAccent">@color/color_accent_dark</item> <item name="colorAccent">@color/color_accent_dark</item>

@ -1,7 +1,7 @@
<resources> <resources>
<!--Light Application Theme Styles--> <!--Light Application Theme Styles-->
<style name="AppTheme" parent="AppThemeBase"> <style name="TuskyTheme" parent="TuskyBaseTheme">
<item name="android:windowLightNavigationBar">true</item> <item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarColor">@color/color_background_light</item> <item name="android:navigationBarColor">@color/color_background_light</item>
<item name="android:navigationBarDividerColor">@color/status_divider_light</item> <item name="android:navigationBarDividerColor">@color/status_divider_light</item>

@ -0,0 +1,3 @@
<resources>
<dimen name="timeline_width">640dp</dimen>
</resources>

@ -31,7 +31,7 @@
<color name="sensitive_media_warning_background_dark">#303030</color> <color name="sensitive_media_warning_background_dark">#303030</color>
<color name="media_preview_unloaded_background_dark">#2F2F2F</color> <color name="media_preview_unloaded_background_dark">#2F2F2F</color>
<color name="status_divider_dark">#2f3441</color> <color name="status_divider_dark">#2f3441</color>
<color name="tab_page_margin_dark">#4C534B</color> <color name="tab_page_margin_dark">#1a1c23</color>
<color name="account_toolbar_icon_collapsed_dark">#FFFFFF</color> <color name="account_toolbar_icon_collapsed_dark">#FFFFFF</color>
<color name="account_header_background_dark">#000000</color> <color name="account_header_background_dark">#000000</color>
<color name="compose_media_button_disabled_dark">#586173</color> <color name="compose_media_button_disabled_dark">#586173</color>
@ -64,7 +64,7 @@
<color name="sensitive_media_warning_background_light">#b0b0b0</color> <color name="sensitive_media_warning_background_light">#b0b0b0</color>
<color name="media_preview_unloaded_background_light">#cfcfcf</color> <color name="media_preview_unloaded_background_light">#cfcfcf</color>
<color name="status_divider_light">#cfcfcf</color> <color name="status_divider_light">#cfcfcf</color>
<color name="tab_page_margin_light">#9F9F9F</color> <color name="tab_page_margin_light">#cfcfcf</color>
<color name="account_toolbar_icon_collapsed_light">#DE000000</color> <color name="account_toolbar_icon_collapsed_light">#DE000000</color>
<color name="account_header_background_light">#EFEFEF</color> <color name="account_header_background_light">#EFEFEF</color>
<color name="compose_media_button_disabled_light">#a3a5ab</color> <color name="compose_media_button_disabled_light">#a3a5ab</color>

@ -20,4 +20,8 @@
<dimen name="compose_activity_snackbar_elevation">16dp</dimen> <dimen name="compose_activity_snackbar_elevation">16dp</dimen>
<dimen name="compose_activity_scrollview_height">-1px</dimen> <!-- match_parent -->
<dimen name="timeline_width">-1px</dimen> <!-- match_parent -->
</resources> </resources>

@ -33,8 +33,9 @@
</style> </style>
<!--Light Application Theme Styles--> <!--Light Application Theme Styles-->
<style name="AppTheme" parent="AppThemeBase"/> <style name="TuskyTheme" parent="TuskyBaseTheme"/>
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar"> <style name="TuskyDialogActivityTheme" parent="@style/TuskyTheme" />
<style name="TuskyBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/color_primary_light</item> <item name="colorPrimary">@color/color_primary_light</item>
<item name="colorPrimaryDark">@color/color_primary_dark_light</item> <item name="colorPrimaryDark">@color/color_primary_dark_light</item>
<item name="colorAccent">@color/color_accent_light</item> <item name="colorAccent">@color/color_accent_light</item>

Loading…
Cancel
Save