fixed Toolbar, renamed class

This commit is contained in:
nuclearfog 2020-05-31 18:42:36 +02:00
parent e28c167d78
commit 385c04cfc1
No known key found for this signature in database
GPG Key ID: ED35E22099354A64
13 changed files with 34 additions and 47 deletions

View File

@ -124,7 +124,7 @@
android:theme="@style/AppTheme" />
<activity
android:name=".activity.UserList"
android:name=".activity.TwitterList"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />

View File

@ -104,9 +104,8 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
root = findViewById(R.id.settings_layout);
load_picker = new NumberPicker(this);
toolbar.setTitle(R.string.settings);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(R.string.settings);
settings = GlobalSettings.getInstance(this);
if (!settings.getLogin())

View File

@ -28,9 +28,8 @@ public class DirectMessage extends AppCompatActivity {
View root = findViewById(R.id.dm_layout);
ViewPager pager = findViewById(R.id.dm_pager);
tool.setTitle(R.string.directmessage);
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(R.string.directmessage);
FragmentAdapter adapter = new FragmentAdapter(getSupportFragmentManager());
adapter.setupMessagePage();

View File

@ -26,6 +26,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
private FragmentAdapter adapter;
private TabLayout tablayout;
private ViewPager pager;
private Toolbar toolbar;
private int tabIndex = 0;
@ -34,7 +35,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
super.onCreate(b);
setContentView(R.layout.page_listdetail);
View root = findViewById(R.id.listdetail_root);
Toolbar toolbar = findViewById(R.id.listdetail_toolbar);
toolbar = findViewById(R.id.listdetail_toolbar);
tablayout = findViewById(R.id.listdetail_tab);
pager = findViewById(R.id.listdetail_pager);
@ -45,7 +46,6 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
pager.setOffscreenPageLimit(2);
tablayout.setupWithViewPager(pager);
tablayout.setSelectedTabIndicatorColor(settings.getHighlightColor());
setSupportActionBar(toolbar);
tablayout.addOnTabSelectedListener(this);
}
@ -68,9 +68,8 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
tlTab.setIcon(R.drawable.list);
trTab.setIcon(R.drawable.user);
}
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(name);
}
toolbar.setTitle(name);
setSupportActionBar(toolbar);
}
}

View File

@ -31,7 +31,6 @@ import static android.widget.Toast.LENGTH_SHORT;
public class LoginPage extends AppCompatActivity implements OnClickListener {
private GlobalSettings settings;
private Registration registerAsync;
private Button btnLink, btnVeri;
private EditText pin;
@ -48,10 +47,8 @@ public class LoginPage extends AppCompatActivity implements OnClickListener {
root = findViewById(R.id.login_root);
pin = findViewById(R.id.pin);
settings = GlobalSettings.getInstance(this);
toolbar.setTitle("");
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
btnLink.setOnClickListener(this);
btnVeri.setOnClickListener(this);
@ -61,6 +58,7 @@ public class LoginPage extends AppCompatActivity implements OnClickListener {
@Override
protected void onStart() {
super.onStart();
GlobalSettings settings = GlobalSettings.getInstance(this);
btnLink.setTypeface(settings.getFontFace());
btnVeri.setTypeface(settings.getFontFace());
pin.setTypeface(settings.getFontFace());

View File

@ -59,16 +59,15 @@ public class MainActivity extends AppCompatActivity implements OnTabSelectedList
tablayout = findViewById(R.id.home_tab);
root = findViewById(R.id.main_layout);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getBackgroundColor());
tablayout.setSelectedTabIndicatorColor(settings.getHighlightColor());
tablayout.setupWithViewPager(pager);
tablayout.addOnTabSelectedListener(this);
pager.setOffscreenPageLimit(3);
toolbar.setTitle("");
setSupportActionBar(toolbar);
tablayout.addOnTabSelectedListener(this);
}

View File

@ -81,9 +81,8 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
View load = View.inflate(this, R.layout.item_load, null);
View cancelButton = load.findViewById(R.id.kill_button);
toolbar.setTitle(R.string.page_profile_edior);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(R.string.page_profile_edior);
GlobalSettings settings = GlobalSettings.getInstance(this);
FontTool.setViewFontAndColor(settings, root);

View File

@ -46,9 +46,8 @@ public class SearchPage extends AppCompatActivity implements OnTabSelectedListen
tabLayout = findViewById(R.id.search_tab);
pager = findViewById(R.id.search_pager);
tool.setTitle("");
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
GlobalSettings settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getBackgroundColor());

View File

@ -108,9 +108,8 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
tweetLocGPS = findViewById(R.id.tweet_location_coordinate);
mediaButton = findViewById(R.id.tweet_media_attach);
tool.setTitle("");
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
settings = GlobalSettings.getInstance(this);
FontTool.setViewFontAndColor(settings, root);

View File

@ -14,7 +14,7 @@ import org.nuclearfog.twidda.backend.helper.FontTool;
import org.nuclearfog.twidda.database.GlobalSettings;
public class UserList extends AppCompatActivity {
public class TwitterList extends AppCompatActivity {
public static final String KEY_USERLIST_ID = "userlist-owner";
private FragmentAdapter adapter;
@ -28,9 +28,8 @@ public class UserList extends AppCompatActivity {
Toolbar toolbar = findViewById(R.id.list_toolbar);
pager = findViewById(R.id.list_pager);
toolbar.setTitle(R.string.list_appbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(R.string.list_appbar);
GlobalSettings settings = GlobalSettings.getInstance(this);
FontTool.setViewFontAndColor(settings, root);

View File

@ -24,21 +24,22 @@ public class UserDetail extends AppCompatActivity {
public static final int USERLIST_RETWEETS = 3;
public static final int USERLIST_SUBSCRBR = 5;
private GlobalSettings settings;
private FragmentAdapter adapter;
private Toolbar toolbar;
private ViewPager pager;
private View root;
@Override
protected void onCreate(@Nullable Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_userlist);
View root = findViewById(R.id.user_view);
Toolbar toolbar = findViewById(R.id.user_toolbar);
root = findViewById(R.id.user_view);
toolbar = findViewById(R.id.user_toolbar);
pager = findViewById(R.id.user_pager);
setSupportActionBar(toolbar);
GlobalSettings settings = GlobalSettings.getInstance(this);
settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getBackgroundColor());
FontTool.setViewFontAndColor(settings, root);
}
@ -49,32 +50,31 @@ public class UserDetail extends AppCompatActivity {
if (adapter == null && param != null && param.containsKey(KEY_USERDETAIL_MODE) && param.containsKey(KEY_USERDETAIL_ID)) {
adapter = new FragmentAdapter(getSupportFragmentManager());
long id = param.getLong(KEY_USERDETAIL_ID);
int titleStr = 0;
switch (param.getInt(KEY_USERDETAIL_MODE)) {
case USERLIST_FRIENDS:
titleStr = R.string.userlist_following;
toolbar.setTitle(R.string.userlist_following);
adapter.setupFriendsPage(id);
break;
case USERLIST_FOLLOWER:
titleStr = R.string.userlist_follower;
toolbar.setTitle(R.string.userlist_follower);
adapter.setupFollowerPage(id);
break;
case USERLIST_RETWEETS:
titleStr = R.string.userlist_retweet;
toolbar.setTitle(R.string.userlist_retweet);
adapter.setupRetweeterPage(id);
break;
case USERLIST_SUBSCRBR:
titleStr = R.string.user_list_subscr;
toolbar.setTitle(R.string.user_list_subscr);
adapter.setupSubscriberPage(id);
break;
}
pager.setAdapter(adapter);
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(titleStr);
setSupportActionBar(toolbar);
FontTool.setViewFontAndColor(settings, root);
}
}
}

View File

@ -56,11 +56,11 @@ import static org.nuclearfog.twidda.activity.MediaViewer.MEDIAVIEWER_IMAGE;
import static org.nuclearfog.twidda.activity.MessagePopup.KEY_DM_PREFIX;
import static org.nuclearfog.twidda.activity.SearchPage.KEY_SEARCH_QUERY;
import static org.nuclearfog.twidda.activity.TweetPopup.KEY_TWEETPOPUP_PREFIX;
import static org.nuclearfog.twidda.activity.TwitterList.KEY_USERLIST_ID;
import static org.nuclearfog.twidda.activity.UserDetail.KEY_USERDETAIL_ID;
import static org.nuclearfog.twidda.activity.UserDetail.KEY_USERDETAIL_MODE;
import static org.nuclearfog.twidda.activity.UserDetail.USERLIST_FOLLOWER;
import static org.nuclearfog.twidda.activity.UserDetail.USERLIST_FRIENDS;
import static org.nuclearfog.twidda.activity.UserList.KEY_USERLIST_ID;
import static org.nuclearfog.twidda.backend.ProfileLoader.Action.LDR_PROFILE;
@ -114,9 +114,8 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
tweetTabTxt = new TextView(this);
favorTabTxt = new TextView(this);
tool.setTitle("");
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
settings = GlobalSettings.getInstance(this);
FontTool.setViewFontAndColor(settings, root);
@ -339,7 +338,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
break;
case R.id.profile_lists:
Intent listPage = new Intent(this, UserList.class);
Intent listPage = new Intent(this, TwitterList.class);
listPage.putExtra(KEY_USERLIST_ID, userId);
startActivity(listPage);
break;

View File

@ -14,9 +14,7 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/home_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.google.android.material.tabs.TabLayout>
android:layout_height="wrap_content" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/home_pager"