v 1.7 layout fix
This commit is contained in:
parent
7890d2953c
commit
27c846954d
@ -8,8 +8,8 @@ android {
|
||||
applicationId 'org.nuclearfog.twidda'
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode 7
|
||||
versionName '1.6.1'
|
||||
versionCode 8
|
||||
versionName '1.7'
|
||||
vectorDrawables.useSupportLibrary true
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,9 @@ import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
public class ListAdapter extends Adapter<ListAdapter.ListHolder> {
|
||||
|
||||
private WeakReference<ListClickListener> listener;
|
||||
@ -76,7 +79,7 @@ public class ListAdapter extends Adapter<ListAdapter.ListHolder> {
|
||||
public void onBindViewHolder(@NonNull ListHolder vh, final int index) {
|
||||
final TwitterList item = data.get(index);
|
||||
final TwitterUser owner = item.getListOwner();
|
||||
vh.title.setText(item.getShortName());
|
||||
vh.title.setText(item.getTitle());
|
||||
vh.ownername.setText(owner.getScreenname());
|
||||
vh.description.setText(item.getDescription());
|
||||
vh.createdAt.setText(StringTools.getTimeString(item.getCreatedAt()));
|
||||
@ -91,34 +94,42 @@ public class ListAdapter extends Adapter<ListAdapter.ListHolder> {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener.get() != null)
|
||||
listener.get().onClick(owner.getId(), item.getShortName(), ListClickListener.Action.PROFILE);
|
||||
listener.get().onClick(owner.getId(), item.getTitle(), ListClickListener.Action.PROFILE);
|
||||
}
|
||||
});
|
||||
vh.followList.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener.get() != null)
|
||||
listener.get().onClick(item.getId(), item.getShortName(), ListClickListener.Action.FOLLOW);
|
||||
listener.get().onClick(item.getId(), item.getTitle(), ListClickListener.Action.FOLLOW);
|
||||
}
|
||||
});
|
||||
vh.subscriberCount.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener.get() != null)
|
||||
listener.get().onClick(item.getId(), item.getShortName(), ListClickListener.Action.SUBSCRIBER);
|
||||
listener.get().onClick(item.getId(), item.getTitle(), ListClickListener.Action.SUBSCRIBER);
|
||||
}
|
||||
});
|
||||
vh.memberCount.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener.get() != null)
|
||||
listener.get().onClick(item.getId(), item.getShortName(), ListClickListener.Action.MEMBER);
|
||||
listener.get().onClick(item.getId(), item.getTitle(), ListClickListener.Action.MEMBER);
|
||||
}
|
||||
});
|
||||
if (item.isFollowing())
|
||||
vh.followList.setText(R.string.unfollow);
|
||||
else
|
||||
vh.followList.setText(R.string.follow);
|
||||
if (item.enableFollow())
|
||||
vh.followList.setVisibility(VISIBLE);
|
||||
else
|
||||
vh.followList.setVisibility(INVISIBLE);
|
||||
if (item.isPrivate())
|
||||
vh.title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.lock, 0, 0, 0);
|
||||
else
|
||||
vh.title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
class ListHolder extends ViewHolder {
|
||||
|
@ -11,8 +11,7 @@ public class TwitterList {
|
||||
|
||||
private final long id;
|
||||
private final long createdAt;
|
||||
private final String shortName;
|
||||
private final String fullName;
|
||||
private final String title;
|
||||
private final String description;
|
||||
|
||||
private final TwitterUser owner;
|
||||
@ -24,8 +23,7 @@ public class TwitterList {
|
||||
|
||||
public TwitterList(UserList list, long homeId) {
|
||||
id = list.getId();
|
||||
shortName = list.getName();
|
||||
fullName = list.getFullName();
|
||||
title = list.getName();
|
||||
createdAt = list.getCreatedAt().getTime();
|
||||
description = list.getDescription();
|
||||
owner = new TwitterUser(list.getUser());
|
||||
@ -55,21 +53,12 @@ public class TwitterList {
|
||||
}
|
||||
|
||||
/**
|
||||
* get short name of list
|
||||
* get title of list
|
||||
*
|
||||
* @return name
|
||||
* @return title name
|
||||
*/
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
/**
|
||||
* get full name of list
|
||||
*
|
||||
* @return name
|
||||
*/
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +128,7 @@ public class TwitterList {
|
||||
@Override
|
||||
@NonNull
|
||||
public String toString() {
|
||||
return shortName + " " + description;
|
||||
return title + " " + description;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,13 +31,15 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/list_padding"
|
||||
android:layout_marginStart="@dimen/list_padding"
|
||||
android:layout_marginEnd="@dimen/list_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/list_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="@dimen/padding_drawable"
|
||||
android:singleLine="true"
|
||||
android:textSize="18sp" />
|
||||
|
||||
@ -64,7 +66,8 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/listitem_margin"
|
||||
android:layout_marginStart="@dimen/listitem_margin"
|
||||
android:layout_marginEnd="@dimen/listitem_margin"
|
||||
android:text="@string/list_created" />
|
||||
|
||||
<TextView
|
||||
@ -91,7 +94,8 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button"
|
||||
android:drawablePadding="@dimen/padding_drawable"
|
||||
android:paddingLeft="@dimen/listitem_button_padding"
|
||||
android:paddingStart="@dimen/listitem_button_padding"
|
||||
android:paddingEnd="@dimen/listitem_button_padding"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
app:drawableStartCompat="@drawable/member" />
|
||||
@ -105,7 +109,8 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button"
|
||||
android:drawablePadding="@dimen/padding_drawable"
|
||||
android:paddingLeft="@dimen/listitem_button_padding"
|
||||
android:paddingStart="@dimen/listitem_button_padding"
|
||||
android:paddingEnd="@dimen/listitem_button_padding"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
app:drawableStartCompat="@drawable/subscriber" />
|
||||
|
@ -8,7 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/dm_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/dm_pager"
|
||||
|
@ -9,7 +9,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/editprofile_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
@ -60,7 +60,7 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/username" />
|
||||
android:hint="@string/username" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_name"
|
||||
@ -85,6 +85,7 @@
|
||||
android:layout_marginBottom="@dimen/margin_layout"
|
||||
android:background="@android:color/transparent"
|
||||
android:ems="10"
|
||||
android:hint="@string/edit_location_hint"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/textsize_profileedit" />
|
||||
@ -92,6 +93,7 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/edit_hint_link"
|
||||
android:text="@string/profile_link" />
|
||||
|
||||
<EditText
|
||||
@ -101,6 +103,7 @@
|
||||
android:layout_marginBottom="@dimen/margin_layout"
|
||||
android:background="@android:color/transparent"
|
||||
android:ems="10"
|
||||
android:hint="@string/edit_hint_link"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/textsize_profileedit" />
|
||||
@ -117,6 +120,7 @@
|
||||
android:background="@android:color/transparent"
|
||||
android:ems="10"
|
||||
android:gravity="top"
|
||||
android:hint="@string/edit_hint_enter_descr"
|
||||
android:inputType="textMultiLine"
|
||||
android:textSize="@dimen/textsize_profileedit" />
|
||||
|
||||
|
@ -8,9 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/list_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/list_pager"
|
||||
|
@ -8,8 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/listdetail_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide"
|
||||
android:theme="?attr/actionBarTheme" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/listdetail_tab"
|
||||
|
@ -9,9 +9,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/login_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -8,7 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/profile_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/home_tab"
|
||||
|
@ -23,7 +23,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/profile_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/profile_header"
|
||||
|
@ -8,7 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/search_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/search_tab"
|
||||
|
@ -9,7 +9,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar_setting"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -23,7 +23,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/tweet_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tweet_head"
|
||||
|
@ -8,7 +8,7 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/user_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
android:layout_height="@dimen/toolbar_height" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/user_pager"
|
||||
|
@ -134,4 +134,7 @@
|
||||
<string name="list_appbar">Listen</string>
|
||||
<string name="user_list_subscr">Listenbeobachter</string>
|
||||
<string name="info_unfollowed">entfolgt!</string>
|
||||
<string name="edit_hint_enter_descr">Profilebeschreibung eingeben</string>
|
||||
<string name="edit_hint_link">Link eingeben</string>
|
||||
<string name="edit_location_hint">Standortnamen eingeben</string>
|
||||
</resources>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="bar_wide">45dp</dimen>
|
||||
<dimen name="toolbar_height">45dp</dimen>
|
||||
<dimen name="divider">2dp</dimen>
|
||||
|
||||
<dimen name="profile_image">64dp</dimen>
|
||||
|
@ -135,4 +135,7 @@
|
||||
<string name="list_appbar">Lists</string>
|
||||
<string name="user_list_subscr">List subscriber</string>
|
||||
<string name="info_unfollowed">unfollowed!</string>
|
||||
<string name="edit_location_hint">Enter location</string>
|
||||
<string name="edit_hint_link">enter internetlink</string>
|
||||
<string name="edit_hint_enter_descr">enter profile description</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user