Fix crash when adding media, make all activities use coordinator layout

This commit is contained in:
Eugen Rochko 2017-03-09 23:21:02 +01:00
parent c9b2092cf9
commit ed262dfb2d
13 changed files with 51 additions and 35 deletions

View file

@ -55,7 +55,7 @@ public interface MastodonAPI {
@Multipart @Multipart
@POST("api/v1/media") @POST("api/v1/media")
Call<Media> uploadMedia(@Part("file") MultipartBody.Part file); Call<Media> uploadMedia(@Part MultipartBody.Part file);
@FormUrlEncoded @FormUrlEncoded
@POST("api/v1/statuses") @POST("api/v1/statuses")

View file

@ -12,6 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.Account.AppBarLayout" android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:id="@+id/account_app_bar_layout"> android:id="@+id/account_app_bar_layout">
<android.support.design.widget.CollapsingToolbarLayout <android.support.design.widget.CollapsingToolbarLayout

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_view_thread" android:id="@+id/activity_view_thread"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -15,6 +16,8 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:elevation="4dp" android:elevation="4dp"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
@ -32,4 +35,4 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_compose" android:id="@+id/activity_compose"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -15,6 +15,8 @@
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:elevation="4dp" android:elevation="4dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
<LinearLayout <LinearLayout
@ -88,4 +90,4 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_send_24dp"/> app:srcCompat="@drawable/ic_send_24dp"/>
</FrameLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_view_thread" android:id="@+id/activity_view_thread"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -16,6 +17,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:elevation="4dp" android:elevation="4dp"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
<FrameLayout <FrameLayout
@ -32,4 +35,4 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -60,4 +60,4 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main" android:id="@+id/activity_main"
@ -20,6 +20,8 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:elevation="4dp" android:elevation="4dp"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
@ -70,4 +72,4 @@
android:layout_margin="16dp" android:layout_margin="16dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_create_24dp"/> app:srcCompat="@drawable/ic_create_24dp"/>
</FrameLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -9,6 +10,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:elevation="4dp" android:elevation="4dp"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView

View file

@ -6,22 +6,14 @@
android:orientation="vertical" android:orientation="vertical"
android:background="@color/color_background_dark" android:background="@color/color_background_dark"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <com.mikhaellopez.circularfillableloaders.CircularFillableLoaders
android:layout_width="match_parent" android:id="@+id/circularFillableLoaders"
android:orientation="vertical" android:layout_width="200dp"
android:gravity="center" android:layout_height="200dp"
android:layout_weight="1" android:src="@mipmap/ic_logo"
android:layout_height="0dp"> app:cfl_border="true"
app:cfl_border_width="4dp"
<com.mikhaellopez.circularfillableloaders.CircularFillableLoaders app:cfl_progress="80"
android:id="@+id/circularFillableLoaders" app:cfl_wave_amplitude="0.08"
android:layout_width="200dp" app:cfl_wave_color="@color/color_primary_dark" />
android:layout_height="200dp"
android:src="@mipmap/ic_logo"
app:cfl_border="true"
app:cfl_border_width="4dp"
app:cfl_progress="80"
app:cfl_wave_amplitude="0.08"
app:cfl_wave_color="@color/color_primary_dark" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_view_thread" android:id="@+id/activity_view_thread"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -15,6 +16,8 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:elevation="4dp" android:elevation="4dp"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
@ -32,4 +35,4 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_view_thread" android:id="@+id/activity_view_thread"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -15,6 +16,8 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Account.AppBarLayout"
app:popupTheme="@style/AppTheme.Account.ToolbarPopupTheme.Dark"
android:elevation="4dp" android:elevation="4dp"
android:background="?attr/toolbar_background_color" /> android:background="?attr/toolbar_background_color" />
@ -32,4 +35,4 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -11,4 +11,4 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerInParent="true" /> android:layout_centerInParent="true" />
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -78,6 +78,8 @@
<style name="AppTheme.Account.ToolbarPopupTheme.Dark" parent="ThemeOverlay.AppCompat"> <style name="AppTheme.Account.ToolbarPopupTheme.Dark" parent="ThemeOverlay.AppCompat">
<item name="android:textColorPrimary">@color/text_color_primary_dark</item> <item name="android:textColorPrimary">@color/text_color_primary_dark</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style> </style>
<!--Light Application Theme Styles--> <!--Light Application Theme Styles-->
@ -138,6 +140,8 @@
<style name="AppTheme.Account.ToolbarPopupTheme.Light" parent="ThemeOverlay.AppCompat"> <style name="AppTheme.Account.ToolbarPopupTheme.Light" parent="ThemeOverlay.AppCompat">
<item name="android:textColorPrimary">@color/text_color_primary_light</item> <item name="android:textColorPrimary">@color/text_color_primary_light</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style> </style>
</resources> </resources>