bug fix, code reformat, gradle plugin update

This commit is contained in:
nuclearfog 2020-05-02 20:11:51 +02:00
parent 5fc2cd9aa4
commit 19bc587e0e
No known key found for this signature in database
GPG Key ID: ED35E22099354A64
8 changed files with 33 additions and 37 deletions

View File

@ -51,7 +51,6 @@ public class MainActivity extends AppCompatActivity implements OnTabSelectedList
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.page_main);
Toolbar toolbar = findViewById(R.id.profile_toolbar);
pager = findViewById(R.id.home_pager);

View File

@ -75,7 +75,6 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_media);
RecyclerView imageList = findViewById(R.id.image_list);
View imageWindow = findViewById(R.id.image_window);

View File

@ -50,23 +50,22 @@ public class MessagePopup extends AppCompatActivity implements OnClickListener {
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.popup_dm);
String addtion = "";
Bundle param = getIntent().getExtras();
if (param != null && param.containsKey(KEY_DM_PREFIX)) {
addtion = param.getString(KEY_DM_PREFIX);
}
View root = findViewById(R.id.dm_popup);
View send = findViewById(R.id.dm_send);
View media = findViewById(R.id.dm_media);
receiver = findViewById(R.id.dm_receiver);
text = findViewById(R.id.dm_text);
Bundle param = getIntent().getExtras();
if (param != null && param.containsKey(KEY_DM_PREFIX)) {
String addtion = param.getString(KEY_DM_PREFIX);
receiver.append(addtion);
}
GlobalSettings settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getPopupColor());
FontTool.setViewFontAndColor(settings, root);
receiver.append(addtion);
send.setOnClickListener(this);
media.setOnClickListener(this);
}

View File

@ -35,7 +35,6 @@ public class SearchPage extends AppCompatActivity implements OnTabSelectedListen
private FragmentAdapter adapter;
private ViewPager pager;
private GlobalSettings settings;
private String search = "";
private int tabIndex = 0;
@ -60,7 +59,7 @@ public class SearchPage extends AppCompatActivity implements OnTabSelectedListen
getSearchString(link);
}
settings = GlobalSettings.getInstance(this);
GlobalSettings settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getBackgroundColor());
tablayout.setSelectedTabIndicatorColor(settings.getHighlightColor());
tablayout.setupWithViewPager(pager);
@ -150,6 +149,7 @@ public class SearchPage extends AppCompatActivity implements OnTabSelectedListen
private void getSearchString(@NonNull Uri link) {
String path = link.getPath();
String query = link.getQuery();
GlobalSettings settings = GlobalSettings.getInstance(this);
if (path != null) {
if (path.startsWith("/hashtag/")) {

View File

@ -72,14 +72,14 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener, O
public static final String KEY_TWEET_NAME = "username";
public static final Pattern linkPattern = Pattern.compile(".*/@?[\\w_]+/status/\\d{1,20}/?.*");
private StatusLoader statusAsync;
private GlobalSettings settings;
private View header, footer, videoButton, imageButton;
private TextView tweet_api, tweetDate, tweetText, scrName, usrName, tweetLocName;
private Button rtwButton, favButton, replyName, tweetLocGPS;
private ImageView profile_img;
private GlobalSettings settings;
private StatusLoader statusAsync;
@Nullable
private Tweet tweet;
private String username;
@ -89,16 +89,6 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener, O
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_tweet);
Bundle param = getIntent().getExtras();
Uri link = getIntent().getData();
settings = GlobalSettings.getInstance(this);
if (param != null && param.containsKey(KEY_TWEET_ID) && param.containsKey(KEY_TWEET_NAME)) {
tweetID = param.getLong(KEY_TWEET_ID);
username = param.getString(KEY_TWEET_NAME);
} else if (link != null) {
getTweet(link);
}
ViewPager pager = findViewById(R.id.tweet_pager);
Toolbar tool = findViewById(R.id.tweet_toolbar);
View root = findViewById(R.id.tweet_layout);
@ -119,6 +109,16 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener, O
imageButton = findViewById(R.id.image_attach);
videoButton = findViewById(R.id.video_attach);
Bundle param = getIntent().getExtras();
Uri link = getIntent().getData();
settings = GlobalSettings.getInstance(this);
if (param != null && param.containsKey(KEY_TWEET_ID) && param.containsKey(KEY_TWEET_NAME)) {
tweetID = param.getLong(KEY_TWEET_ID);
username = param.getString(KEY_TWEET_NAME);
} else if (link != null) {
getTweet(link);
}
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);

View File

@ -31,6 +31,9 @@ public class UserDetail extends AppCompatActivity {
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_userlist);
View root = findViewById(R.id.user_view);
ViewPager pager = findViewById(R.id.user_pager);
Toolbar toolbar = findViewById(R.id.user_toolbar);
Bundle param = getIntent().getExtras();
if (param != null && param.containsKey(KEY_USERDETAIL_MODE) && param.containsKey(KEY_USERDETAIL_ID)) {
@ -38,17 +41,13 @@ public class UserDetail extends AppCompatActivity {
id = param.getLong(KEY_USERDETAIL_ID);
}
FragmentAdapter adapter;
View root = findViewById(R.id.user_view);
ViewPager pager = findViewById(R.id.user_pager);
Toolbar toolbar = findViewById(R.id.user_toolbar);
GlobalSettings settings = GlobalSettings.getInstance(this);
root.setBackgroundColor(settings.getBackgroundColor());
setSupportActionBar(toolbar);
switch (mode) {
case USERLIST_FRIENDS:
FragmentAdapter adapter;
if (getSupportActionBar() != null)
getSupportActionBar().setTitle(R.string.userlist_following);
adapter = new FragmentAdapter(getSupportFragmentManager(), AdapterType.FRIENDS_PAGE, id, "");

View File

@ -99,13 +99,6 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.page_profile);
settings = GlobalSettings.getInstance(this);
Bundle param = getIntent().getExtras();
if (param != null && param.containsKey(KEY_PROFILE_ID)) {
userId = param.getLong(KEY_PROFILE_ID);
isHome = userId == settings.getUserId();
}
Toolbar tool = findViewById(R.id.profile_toolbar);
TabLayout tab = findViewById(R.id.profile_tab);
ViewGroup root = findViewById(R.id.user_view);
@ -126,6 +119,13 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
tweetTabTxt = new TextView(this);
favorTabTxt = new TextView(this);
settings = GlobalSettings.getInstance(this);
Bundle param = getIntent().getExtras();
if (param != null && param.containsKey(KEY_PROFILE_ID)) {
userId = param.getLong(KEY_PROFILE_ID);
isHome = userId == settings.getUserId();
}
setSupportActionBar(tool);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);

View File

@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:3.6.3'
}
}