From 596e99a92d052043f7f7d1e64f1499261b94e999 Mon Sep 17 00:00:00 2001 From: NudeDude Date: Sun, 12 May 2019 23:48:29 +0200 Subject: [PATCH] layout fix --- .../twidda/adapter/MessageAdapter.java | 15 ++++- .../twidda/adapter/TweetAdapter.java | 23 +++---- .../twidda/adapter/UserAdapter.java | 18 ++--- .../res/drawable/ic_launcher_background.xml | 6 +- .../res/drawable/ic_launcher_foreground.xml | 24 +++---- app/src/main/res/layout/item_dm.xml | 13 ++-- app/src/main/res/layout/item_tweet.xml | 67 ++++--------------- app/src/main/res/layout/item_user.xml | 60 ++++------------- app/src/main/res/layout/page_profile.xml | 4 +- app/src/main/res/layout/popup_dm.xml | 8 ++- app/src/main/res/layout/popup_tweet.xml | 12 ++-- .../res/mipmap-anydpi-v26/ic_launcher.xml | 4 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 4 +- app/src/main/res/values-de-rDE/strings.xml | 9 --- app/src/main/res/values/dimens.xml | 6 +- app/src/main/res/values/strings.xml | 9 --- app/src/main/res/values/styles.xml | 17 ++--- 17 files changed, 108 insertions(+), 191 deletions(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/adapter/MessageAdapter.java b/app/src/main/java/org/nuclearfog/twidda/adapter/MessageAdapter.java index 9f729ec4..8a3969ce 100644 --- a/app/src/main/java/org/nuclearfog/twidda/adapter/MessageAdapter.java +++ b/app/src/main/java/org/nuclearfog/twidda/adapter/MessageAdapter.java @@ -18,6 +18,7 @@ import org.nuclearfog.tag.Tagger; import org.nuclearfog.tag.Tagger.OnTagClickListener; import org.nuclearfog.twidda.R; import org.nuclearfog.twidda.backend.items.Message; +import org.nuclearfog.twidda.backend.items.TwitterUser; import java.lang.ref.WeakReference; import java.text.SimpleDateFormat; @@ -115,6 +116,7 @@ public class MessageAdapter extends RecyclerView.Adapter { vh.time.setTextColor(font_color); if (tweet.retweeted()) - vh.rtButton.setImageResource(R.drawable.retweet_enabled); + vh.retweet.setCompoundDrawablesWithIntrinsicBounds(R.drawable.retweet_enabled, 0, 0, 0); else - vh.rtButton.setImageResource(R.drawable.retweet); + vh.retweet.setCompoundDrawablesWithIntrinsicBounds(R.drawable.retweet, 0, 0, 0); if (tweet.favored()) - vh.fvButton.setImageResource(R.drawable.favorite_enabled); + vh.favorite.setCompoundDrawablesWithIntrinsicBounds(R.drawable.favorite_enabled, 0, 0, 0); else - vh.fvButton.setImageResource(R.drawable.favorite); + vh.favorite.setCompoundDrawablesWithIntrinsicBounds(R.drawable.favorite, 0, 0, 0); if (tweet.getUser().isVerified()) - vh.verify.setVisibility(View.VISIBLE); + vh.username.setCompoundDrawablesWithIntrinsicBounds(R.drawable.verify, 0, 0, 0); else - vh.verify.setVisibility(View.GONE); + vh.username.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); if (tweet.getUser().isLocked()) - vh.lock.setVisibility(View.VISIBLE); + vh.screenname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.lock, 0, 0, 0); else - vh.lock.setVisibility(View.GONE); + vh.screenname.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); if (image_load) Picasso.get().load(tweet.getUser().getImageLink() + "_mini").into(vh.profile); } @@ -177,8 +177,7 @@ public class TweetAdapter extends Adapter { class ItemHolder extends ViewHolder { final TextView username, screenname, tweet, retweet; final TextView favorite, retweeter, time; - final ImageView profile, verify, lock; - final ImageView rtButton, fvButton; + final ImageView profile; ItemHolder(View v) { super(v); @@ -190,10 +189,6 @@ public class TweetAdapter extends Adapter { retweeter = v.findViewById(R.id.retweeter); time = v.findViewById(R.id.time); profile = v.findViewById(R.id.tweetPb); - verify = v.findViewById(R.id.list_verify); - lock = v.findViewById(R.id.list_locked); - rtButton = v.findViewById(R.id.rt_button); - fvButton = v.findViewById(R.id.fv_button); } } } \ No newline at end of file diff --git a/app/src/main/java/org/nuclearfog/twidda/adapter/UserAdapter.java b/app/src/main/java/org/nuclearfog/twidda/adapter/UserAdapter.java index 7d3aa406..54d00a5f 100644 --- a/app/src/main/java/org/nuclearfog/twidda/adapter/UserAdapter.java +++ b/app/src/main/java/org/nuclearfog/twidda/adapter/UserAdapter.java @@ -88,31 +88,29 @@ public class UserAdapter extends Adapter { @Override public void onBindViewHolder(@NonNull ItemHolder vh, int index) { TwitterUser user = mUser[index]; - vh.screenname.setText(user.getScreenname()); vh.username.setText(user.getUsername()); - - vh.screenname.setTextColor(font_color); vh.username.setTextColor(font_color); - + vh.screenname.setText(user.getScreenname()); + vh.screenname.setTextColor(font_color); if (loadImage) { Picasso.get().load(user.getImageLink() + "_mini").into(vh.profileImg); } if (user.isVerified()) { - vh.verifyIco.setVisibility(View.VISIBLE); + vh.username.setCompoundDrawablesWithIntrinsicBounds(R.drawable.verify, 0, 0, 0); } else { - vh.verifyIco.setVisibility(View.GONE); + vh.username.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); } if (user.isLocked()) { - vh.lockIco.setVisibility(View.VISIBLE); + vh.screenname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.lock, 0, 0, 0); } else { - vh.lockIco.setVisibility(View.GONE); + vh.screenname.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); } } class ItemHolder extends ViewHolder { - final ImageView profileImg, verifyIco, lockIco; + final ImageView profileImg; final TextView username, screenname; ItemHolder(View v) { @@ -120,8 +118,6 @@ public class UserAdapter extends Adapter { username = v.findViewById(R.id.username_detail); screenname = v.findViewById(R.id.screenname_detail); profileImg = v.findViewById(R.id.user_profileimg); - verifyIco = v.findViewById(R.id.verified); - lockIco = v.findViewById(R.id.locked_profile); } } } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index c3f28b51..499c699c 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -3,7 +3,7 @@ android:height="108dp" android:viewportWidth="108" android:viewportHeight="108"> - + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 1925abea..d0829148 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -3,16 +3,16 @@ android:height="108dp" android:viewportWidth="108" android:viewportHeight="108"> - - - - + + + + diff --git a/app/src/main/res/layout/item_dm.xml b/app/src/main/res/layout/item_dm.xml index 8a7d2626..ac1f475b 100644 --- a/app/src/main/res/layout/item_dm.xml +++ b/app/src/main/res/layout/item_dm.xml @@ -18,13 +18,15 @@ + android:layout_width="@dimen/profile_middle" + android:layout_height="@dimen/profile_middle" + android:layout_marginRight="@dimen/layout_margin" + android:layout_marginEnd="@dimen/layout_margin"> @@ -39,6 +41,7 @@ @@ -65,6 +69,7 @@ android:id="@+id/dm_screenname" android:layout_width="match_parent" android:layout_height="wrap_content" + android:drawablePadding="@dimen/drawable_padding" android:singleLine="true" android:textSize="12sp" /> diff --git a/app/src/main/res/layout/item_tweet.xml b/app/src/main/res/layout/item_tweet.xml index 564f24fa..a9e62508 100644 --- a/app/src/main/res/layout/item_tweet.xml +++ b/app/src/main/res/layout/item_tweet.xml @@ -1,6 +1,5 @@ @@ -21,7 +20,8 @@ + android:layout_height="@dimen/profile_small" + android:layout_marginRight="@dimen/layout_margin"> - - - - - - - - + android:drawablePadding="@dimen/drawable_padding" + android:singleLine="true" /> @@ -119,41 +92,25 @@ android:id="@+id/retweeter" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="3" + android:layout_weight="1" android:singleLine="true" android:textSize="12sp" /> - - - - diff --git a/app/src/main/res/layout/item_user.xml b/app/src/main/res/layout/item_user.xml index cfb43b8f..64f3ccf9 100644 --- a/app/src/main/res/layout/item_user.xml +++ b/app/src/main/res/layout/item_user.xml @@ -1,6 +1,5 @@ @@ -15,7 +14,8 @@ + android:layout_height="@dimen/profile_middle" + android:layout_marginRight="@dimen/layout_margin"> - + android:layout_height="wrap_content" + android:drawablePadding="@dimen/drawable_padding" + android:singleLine="true" /> - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:drawablePadding="@dimen/drawable_padding" + android:singleLine="true" /> diff --git a/app/src/main/res/layout/page_profile.xml b/app/src/main/res/layout/page_profile.xml index ffd24bea..d6b3d7fd 100644 --- a/app/src/main/res/layout/page_profile.xml +++ b/app/src/main/res/layout/page_profile.xml @@ -140,7 +140,6 @@ android:id="@+id/bio" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/layout_margin" android:autoLink="web" android:linksClickable="true" android:maxLines="@integer/max_bio_lines" @@ -150,6 +149,7 @@ android:id="@+id/location" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/layout_margin" android:drawablePadding="@dimen/drawable_padding" android:singleLine="true" android:textSize="12sp" @@ -160,6 +160,7 @@ android:id="@+id/links" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/layout_margin" android:drawablePadding="@dimen/drawable_padding" android:linksClickable="true" android:singleLine="true" @@ -171,6 +172,7 @@ android:id="@+id/profile_date" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/layout_margin" android:drawablePadding="@dimen/drawable_padding" android:singleLine="true" android:textSize="12sp" diff --git a/app/src/main/res/layout/popup_dm.xml b/app/src/main/res/layout/popup_dm.xml index 49a1a2c4..c60e369d 100644 --- a/app/src/main/res/layout/popup_dm.xml +++ b/app/src/main/res/layout/popup_dm.xml @@ -24,28 +24,30 @@ - - diff --git a/app/src/main/res/layout/popup_tweet.xml b/app/src/main/res/layout/popup_tweet.xml index 347693ea..de6e9afa 100644 --- a/app/src/main/res/layout/popup_tweet.xml +++ b/app/src/main/res/layout/popup_tweet.xml @@ -37,40 +37,44 @@ android:textColor="@android:color/holo_red_dark" android:textSize="18sp" /> - - - - diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index bbd3e021..eca70cfe 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index bbd3e021..eca70cfe 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index e5d47359..0c2b6539 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -2,10 +2,7 @@ Schrift Hervorhebung - verifiziert - Privat Anzahl Tweets - Folgt dir folgen wiederholen abbrechen @@ -25,8 +22,6 @@ Tweet löschen? Keine Internetverbindung! PIN eingeben! - PIN eingefügt! - Falsches Format! Datenbank löschen? "Rate-Limit erreicht, weiter in (s): " Fehler beim Senden! @@ -77,11 +72,7 @@ Zeichenlimit erreicht! Link in Zwischenablage kopieren Link in Zwischenablage kopiert! - Standortname Link - Profil erstellt am - Von Zwischenablage einfügen - Clipboard Symbol Bildvorschau button Antwort Button Retweet Button diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 3b45b15d..5fd0a3f8 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,13 +4,11 @@ 64dp 40dp 36dp - 14dp 5dp 10dp 5dp 2dp 48dp - 24dp 5dp 300dp 40dp @@ -21,9 +19,9 @@ 56dp 20dp 5dp - 32dp + 40dp 16dp - 32dp + 40dp 150dp 20dp 5dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c892bb29..6cb8028c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,15 +14,12 @@ Font Popup Highlight - verified - locked tweet count Block follow retry cancel! Color settings - follows you data consumption trend setting profile @@ -33,8 +30,6 @@ delete tweet? connection failed Enter PIN - PIN added! - not valid! delete database? "Rate limit exceeded, retry after(s): " error while sending @@ -85,11 +80,7 @@ char limit reached! copy link to clipboard Link copied to clipboard! - Location name link - profile creation date - paste from clipboard - clipboard icon image preview button answer button retweet button diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b8676d42..7f67856f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -7,7 +7,7 @@ @android:color/black @style/TransactionPending @style/RobotoTextView - @style/CustomButton + @style/RobotoButton false @@ -26,8 +26,14 @@ @android:anim/fade_out - + + - - \ No newline at end of file