Layout changes

This commit is contained in:
tom79 2020-03-07 12:10:52 +01:00
parent 1cd76098a0
commit 43b3370c31
5 changed files with 52 additions and 46 deletions

View File

@ -72,13 +72,13 @@ task gitPushReleaseNotes(type: Exec, dependsOn: 'copyAllReleaseNotes') {
dependencies { dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0' implementation 'androidx.exifinterface:exifinterface:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation "com.github.bumptech.glide:glide:4.11.0" implementation "com.github.bumptech.glide:glide:4.11.0"
implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") { implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") {
// Excludes the support library because it's already included by Glide. // Excludes the support library because it's already included by Glide.
@ -129,6 +129,6 @@ dependencies {
implementation 'com.github.penfeizhou.android.animation:gif:1.1.0' implementation 'com.github.penfeizhou.android.animation:gif:1.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.2' implementation 'com.github.smarteist:autoimageslider:1.3.2'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
implementation 'com.jaredrummler:cyanea:1.0.2' implementation 'com.jaredrummler:cyanea:1.0.2'
} }

View File

@ -1568,27 +1568,30 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show(); Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
} }
}); });
holder.fetch_more.setOnLongClickListener(v -> { holder.fetch_more.setOnLongClickListener(new View.OnLongClickListener() {
status.setFetchMore(false); @Override
holder.fetch_more.setEnabled(false); public boolean onLongClick(View v) {
holder.fetch_more.setVisibility(View.GONE); status.setFetchMore(false);
if (context instanceof BaseMainActivity) { holder.fetch_more.setEnabled(false);
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open(); holder.fetch_more.setVisibility(View.GONE);
List<ManageTimelines> timelines = new TimelinesDAO(context, db).getDisplayedTimelines(); if (context instanceof BaseMainActivity) {
for (ManageTimelines tl : timelines) { SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
if (tl.getType() == ManageTimelines.Type.HOME && mPageReferenceMap != null) { List<ManageTimelines> timelines = new TimelinesDAO(context, db).getDisplayedTimelines();
DisplayStatusFragment homeFragment = (DisplayStatusFragment) mPageReferenceMap.get(tl.getPosition()); for (ManageTimelines tl : timelines) {
if (homeFragment != null) { if (tl.getType() == ManageTimelines.Type.HOME && mPageReferenceMap != null) {
fetch_all_more = true; DisplayStatusFragment homeFragment = (DisplayStatusFragment) mPageReferenceMap.get(tl.getPosition());
homeFragment.fetchMore(status.getId()); if (homeFragment != null) {
fetch_all_more = true;
homeFragment.fetchMore(status.getId());
}
break;
} }
break;
} }
} else {
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
} }
} else { return false;
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
} }
return false;
}); });
} else { } else {
holder.fetch_more.setVisibility(View.GONE); holder.fetch_more.setVisibility(View.GONE);
@ -1684,12 +1687,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
} }
int statusColor = prefs.getInt("theme_statuses_color", -1); int statusColor = prefs.getInt("theme_statuses_color", -1);
if (holder.main_card_container != null && statusColor != -1) { if (holder.main_card_container != null && statusColor != -1) {
holder.main_card_container.setCardBackgroundColor(statusColor); holder.main_card_container.setBackgroundColor(statusColor);
if (holder.translation_label != null) { if (holder.translation_label != null) {
holder.translation_label.setBackgroundColor(statusColor); holder.translation_label.setBackgroundColor(statusColor);
} }
} else if (holder.main_card_container != null) { } else if (holder.main_card_container != null) {
holder.main_card_container.setCardBackgroundColor(ThemeHelper.getAttColor(context, R.attr.cardviewColor)); holder.main_card_container.setBackgroundColor(ThemeHelper.getAttColor(context, R.attr.cardviewColor));
if (holder.translation_label != null) { if (holder.translation_label != null) {
holder.translation_label.setBackgroundColor(ThemeHelper.getAttColor(context, R.attr.cardviewColor)); holder.translation_label.setBackgroundColor(ThemeHelper.getAttColor(context, R.attr.cardviewColor));
} }
@ -3970,7 +3973,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Button quick_reply_button; Button quick_reply_button;
ImageView quick_reply_privacy; ImageView quick_reply_privacy;
View status_reply_indicator_top, reply_indicator_dot, status_reply_indicator_bottom, status_reply_indicator_diag_top, status_reply_indicator_diag_bottom; View status_reply_indicator_top, reply_indicator_dot, status_reply_indicator_bottom, status_reply_indicator_diag_top, status_reply_indicator_diag_bottom;
CardView main_card_container; RelativeLayout main_card_container;
LinearLayout main_linear_container; LinearLayout main_linear_container;
View translation_border_view; View translation_border_view;
TextView translation_label; TextView translation_label;

View File

@ -238,6 +238,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
statusDrawerParams.setTagTimeline(tagTimelines.get(0)); statusDrawerParams.setTagTimeline(tagTimelines.get(0));
statusDrawerParams.setTargetedId(targetedId); statusDrawerParams.setTargetedId(targetedId);
statusDrawerParams.setOnWifi(isOnWifi); statusDrawerParams.setOnWifi(isOnWifi);
statusDrawerParams.setType(type);
statusDrawerParams.setStatuses(this.statuses); statusDrawerParams.setStatuses(this.statuses);
statusListAdapter = new StatusListAdapter(statusDrawerParams); statusListAdapter = new StatusListAdapter(statusDrawerParams);
@ -251,6 +252,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
statusDrawerParams.setTargetedId(targetedId); statusDrawerParams.setTargetedId(targetedId);
statusDrawerParams.setOnWifi(isOnWifi); statusDrawerParams.setOnWifi(isOnWifi);
statusDrawerParams.setStatuses(this.statuses); statusDrawerParams.setStatuses(this.statuses);
statusDrawerParams.setType(type);
statusListAdapter = new StatusListAdapter(statusDrawerParams); statusListAdapter = new StatusListAdapter(statusDrawerParams);
lv_status.setAdapter(statusListAdapter); lv_status.setAdapter(statusListAdapter);
} }
@ -276,6 +278,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
lv_status.setAdapter(artListAdapter); lv_status.setAdapter(artListAdapter);
} }
mLayoutManager = new LinearLayoutManager(context); mLayoutManager = new LinearLayoutManager(context);
lv_status.setLayoutManager(mLayoutManager); lv_status.setLayoutManager(mLayoutManager);

View File

@ -54,7 +54,7 @@
app:layout_constraintTop_toTopOf="@id/reply_indicator_dot" /> app:layout_constraintTop_toTopOf="@id/reply_indicator_dot" />
<androidx.cardview.widget.CardView <RelativeLayout
android:id="@+id/main_card_container" android:id="@+id/main_card_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -260,7 +260,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:contentDescription="@string/delete" android:contentDescription="@string/delete"
android:src="@drawable/ic_clear_toot" android:src="@drawable/ic_clear_toot"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/fedilab_features" app:layout_constraintEnd_toEndOf="@id/fedilab_features"
app:layout_constraintStart_toStartOf="@id/fedilab_features" app:layout_constraintStart_toStartOf="@id/fedilab_features"
@ -290,7 +290,7 @@
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:contentDescription="@string/cached_status" android:contentDescription="@string/cached_status"
android:src="@drawable/ic_cached_black" android:src="@drawable/ic_cached_black"
android:tint="?attr/textColor" app:tint="?attr/textColor"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/status_account_displayname_owner" app:layout_constraintBottom_toBottomOf="@id/status_account_displayname_owner"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -392,7 +392,7 @@
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:text="@string/display_toot_truncate" android:text="@string/display_toot_truncate"
android:textAllCaps="false" android:textAllCaps="false"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
@ -704,7 +704,7 @@
android:contentDescription="@string/show_media" android:contentDescription="@string/show_media"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/ic_remove_red_eye_img" android:src="@drawable/ic_remove_red_eye_img"
android:tint="@color/white" /> app:tint="@color/white" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -746,7 +746,7 @@
android:contentDescription="@string/hide_media" android:contentDescription="@string/hide_media"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/ic_remove_red_eye_img" android:src="@drawable/ic_remove_red_eye_img"
android:tint="?attr/iconColor" /> app:tint="?attr/iconColor" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -936,7 +936,7 @@
android:layout_height="30dp" android:layout_height="30dp"
android:contentDescription="@string/reply" android:contentDescription="@string/reply"
android:src="@drawable/ic_reply" android:src="@drawable/ic_reply"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -999,7 +999,7 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:contentDescription="@string/pin_add" android:contentDescription="@string/pin_add"
android:src="@drawable/ic_pin_drop" android:src="@drawable/ic_pin_drop"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/status_favorite_count" app:layout_constraintStart_toEndOf="@id/status_favorite_count"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -1009,7 +1009,7 @@
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/status_more" app:layout_constraintEnd_toStartOf="@id/status_more"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -1020,7 +1020,7 @@
android:layout_height="25dp" android:layout_height="25dp"
android:contentDescription="@string/display_toot_truncate" android:contentDescription="@string/display_toot_truncate"
android:src="@drawable/ic_more_horiz" android:src="@drawable/ic_more_horiz"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -1058,6 +1058,6 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -56,7 +56,7 @@
app:layout_constraintStart_toStartOf="@id/reply_indicator_dot" app:layout_constraintStart_toStartOf="@id/reply_indicator_dot"
app:layout_constraintTop_toTopOf="@id/reply_indicator_dot" /> app:layout_constraintTop_toTopOf="@id/reply_indicator_dot" />
<androidx.cardview.widget.CardView <RelativeLayout
android:id="@+id/main_card_container" android:id="@+id/main_card_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -247,7 +247,7 @@
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:contentDescription="@string/cached_status" android:contentDescription="@string/cached_status"
android:src="@drawable/ic_cached_black" android:src="@drawable/ic_cached_black"
android:tint="?attr/textColor" app:tint="?attr/textColor"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/status_account_displayname_owner" app:layout_constraintBottom_toBottomOf="@id/status_account_displayname_owner"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -626,7 +626,7 @@
android:contentDescription="@string/hide_media" android:contentDescription="@string/hide_media"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/ic_remove_red_eye_img" android:src="@drawable/ic_remove_red_eye_img"
android:tint="?attr/iconColor" /> app:tint="?attr/iconColor" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -667,7 +667,7 @@
android:contentDescription="@string/hide_media" android:contentDescription="@string/hide_media"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/ic_remove_red_eye_img" android:src="@drawable/ic_remove_red_eye_img"
android:tint="?attr/iconColor" /> app:tint="?attr/iconColor" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -855,7 +855,7 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@drawable/ic_share_peertube" android:src="@drawable/ic_share_peertube"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -873,7 +873,7 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@drawable/ic_reply" android:src="@drawable/ic_reply"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -954,7 +954,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:contentDescription="@string/delete" android:contentDescription="@string/delete"
android:src="@drawable/ic_clear_toot" android:src="@drawable/ic_clear_toot"
android:tint="?attr/iconColorMenu" app:tint="?attr/iconColorMenu"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/new_element" app:layout_constraintStart_toEndOf="@id/new_element"
@ -967,7 +967,7 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:contentDescription="@string/pin_add" android:contentDescription="@string/pin_add"
android:src="@drawable/ic_pin_drop" android:src="@drawable/ic_pin_drop"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/status_remove" app:layout_constraintStart_toEndOf="@id/status_remove"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -987,7 +987,7 @@
android:layout_height="25dp" android:layout_height="25dp"
android:contentDescription="@string/display_toot_truncate" android:contentDescription="@string/display_toot_truncate"
android:src="@drawable/ic_more_horiz" android:src="@drawable/ic_more_horiz"
android:tint="?attr/iconColor" app:tint="?attr/iconColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -1031,6 +1031,6 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>