layout fix

This commit is contained in:
NudeDude 2018-09-19 15:51:55 +02:00
parent 850076b215
commit 94e920630e
11 changed files with 70 additions and 21 deletions

View File

@ -39,6 +39,7 @@ public class MessageLoader extends AsyncTask<Void, Void, Boolean> {
if (mAdapter == null) {
mAdapter = new MessageAdapter(context);
mAdapter.setColor(settings.getFontColor());
mAdapter.setImageLoad(settings.loadImages());
dm_list.setAdapter(mAdapter);
}

View File

@ -33,9 +33,6 @@ public class UserLists extends AsyncTask<Long, Void, Boolean> {
public UserLists(UserDetail context) {
GlobalSettings settings = GlobalSettings.getInstance(context);
boolean imageLoad = settings.loadImages();
ui = new WeakReference<>(context);
mTwitter = TwitterEngine.getInstance(context);
RecyclerView userList = context.findViewById(R.id.userlist);
@ -43,8 +40,10 @@ public class UserLists extends AsyncTask<Long, Void, Boolean> {
usrAdp = (UserAdapter) userList.getAdapter();
if (usrAdp == null) {
GlobalSettings settings = GlobalSettings.getInstance(context);
usrAdp = new UserAdapter(context);
usrAdp.toggleImage(imageLoad);
usrAdp.toggleImage(settings.loadImages());
usrAdp.setColor(settings.getFontColor());
userList.setAdapter(usrAdp);
}
}

View File

@ -25,6 +25,7 @@ public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MessageH
private List<Message> messages;
private OnItemSelected mListener;
private boolean loadImage = true;
private int color = 0xFFFFFFFF;
public MessageAdapter(OnItemSelected listener) {
@ -48,6 +49,11 @@ public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MessageH
}
public void setColor(int color) {
this.color = color;
}
@Override
public long getItemId(int pos) {
return messages.get(pos).messageId;
@ -83,6 +89,12 @@ public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MessageH
vh.username.setText(message.sender.username);
vh.screenname.setText(message.sender.screenname);
vh.createdAt.setText(stringTime(message.time));
vh.message.setTextColor(color);
vh.username.setTextColor(color);
vh.screenname.setTextColor(color);
vh.createdAt.setTextColor(color);
if (loadImage)
Picasso.get().load(message.sender.profileImg + "_mini").into(vh.profile_img);
}

View File

@ -107,13 +107,19 @@ public class TimelineAdapter extends Adapter<TimelineAdapter.ItemHolder> {
} else {
vh.retweeter.setText("");
}
vh.tweet.setTextColor(font_color);
vh.username.setText(tweet.user.username);
vh.screenname.setText(tweet.user.screenname);
vh.tweet.setText(highlight(tweet.tweet));
vh.retweet.setText(retweet);
vh.favorite.setText(favorit);
vh.time.setText(stringTime(tweet.time));
vh.username.setTextColor(font_color);
vh.screenname.setTextColor(font_color);
vh.tweet.setTextColor(font_color);
vh.time.setTextColor(font_color);
if (img_ldr) {
Picasso.get().load(tweet.user.profileImg + "_mini").into(vh.profile);
}

View File

@ -23,6 +23,7 @@ public class UserAdapter extends Adapter<UserAdapter.ItemHolder> {
private List<TwitterUser> mUser;
private OnItemClicked mListener;
private int font_color = 0xFFFFFFFF;
private boolean loadImage = true;
@ -47,6 +48,11 @@ public class UserAdapter extends Adapter<UserAdapter.ItemHolder> {
}
public void setColor(int font_color) {
this.font_color = font_color;
}
@Override
public int getItemCount() {
return mUser.size();
@ -80,6 +86,11 @@ public class UserAdapter extends Adapter<UserAdapter.ItemHolder> {
TwitterUser user = mUser.get(index);
vh.screenname.setText(user.screenname);
vh.username.setText(user.username);
vh.screenname.setTextColor(font_color);
vh.username.setTextColor(font_color);
if (loadImage) {
Picasso.get().load(user.profileImg + "_mini").into(vh.profileImg);
}

View File

@ -21,6 +21,11 @@ import org.nuclearfog.twidda.viewadapter.MessageAdapter.OnItemSelected;
import static android.os.AsyncTask.Status.RUNNING;
/**
* Direct Message page
*
* @see MessageLoader
*/
public class DirectMessage extends AppCompatActivity implements OnItemSelected, OnRefreshListener {
private MessageLoader mLoader;
@ -32,6 +37,7 @@ public class DirectMessage extends AppCompatActivity implements OnItemSelected,
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_dm);
Toolbar tool = findViewById(R.id.dm_toolbar);
setSupportActionBar(tool);
if (getSupportActionBar() != null)

View File

@ -14,9 +14,11 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="fill_vertical"
android:orientation="horizontal">
<android.support.v7.widget.CardView
style="@style/ProfileImageCardView"
android:layout_width="@dimen/profile_small"
android:layout_height="@dimen/profile_small"
app:cardCornerRadius="5dp">

View File

@ -17,11 +17,13 @@
android:orientation="horizontal">
<android.support.v7.widget.CardView
style="@style/ProfileImageCardView"
android:layout_width="@dimen/profile_small"
android:layout_height="@dimen/profile_small">
<ImageView
android:id="@+id/tweetPb"
style="@style/ProfileImageCardView"
android:layout_width="@dimen/profile_small"
android:layout_height="@dimen/profile_small"
android:layout_gravity="center_vertical"

View File

@ -12,6 +12,7 @@
android:padding="5dp">
<android.support.v7.widget.CardView
style="@style/ProfileImageCardView"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="10dp">
@ -31,44 +32,48 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/verified"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_margin="2dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginEnd="3dp"
android:background="@drawable/verify"
android:contentDescription="@string/verify"
android:visibility="gone" />
android:visibility="visible" />
<TextView
android:id="@+id/username_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_weight="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/locked_profile"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_margin="2dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginEnd="3dp"
android:background="@drawable/lock"
android:contentDescription="@string/profile_locked"
android:visibility="gone" />
android:visibility="visible" />
<TextView
android:id="@+id/screenname_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_weight="1"
android:singleLine="true" />
</LinearLayout>

View File

@ -40,6 +40,7 @@
android:orientation="horizontal">
<android.support.v7.widget.CardView
style="@style/ProfileImageCardView"
android:layout_width="@dimen/profile_image"
android:layout_height="@dimen/profile_image">

View File

@ -4,9 +4,9 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/soylentgreen</item>
<item name="android:colorBackground">@color/DarkBlue</item>
<item name="android:windowAnimationStyle">@style/TransactionPending</item>
<item name="android:colorBackground">@android:color/black</item>
<item name="android:statusBarColor">@android:color/black</item>
<item name="android:windowAnimationStyle">@style/TransactionPending</item>
<item name="android:textViewStyle">@style/RobotoTextView</item>
<item name="buttonStyle">@style/CustomButton</item>
</style>
@ -31,6 +31,10 @@
<item name="cardUseCompatPadding">true</item>
</style>
<style name="ProfileImageCardView" parent="CardView">
<item name="cardCornerRadius">5dp</item>
</style>
<style name="CustomButton" parent="Widget.AppCompat.Button">
<item name="android:textAllCaps">false</item>
<item name="android:fontFamily">RobotoTextView</item>