Cleanup
This commit is contained in:
NudeDude 2018-03-27 23:15:38 +02:00
parent 0e9c3cd487
commit 5a3d661f9a
21 changed files with 17 additions and 15 deletions

View File

@ -66,6 +66,7 @@ public class MainActivity extends AppCompatActivity implements
startActivityForResult(i,REQCODE);
} else {
login();
setTabContent();
}
}
@ -75,6 +76,7 @@ public class MainActivity extends AppCompatActivity implements
if(reqCode == REQCODE) {
if(returnCode == RESULT_OK) {
login();
setTabContent();
} else {
finish();
}
@ -312,8 +314,6 @@ public class MainActivity extends AppCompatActivity implements
timelineReload.setOnRefreshListener(this);
trendReload.setOnRefreshListener(this);
mentionReload.setOnRefreshListener(this);
setTabContent();
}
/**

View File

@ -80,7 +80,7 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> implements View.On
try {
Tweet tweet = mTwitter.getStatus(tweetID);
if(tweet.embedded != null) {
retweeter = "Retweet "+tweet.user.screenname;
retweeter = tweet.user.screenname;
retweeterID = tweet.user.userID;
tweet = tweet.embedded;
tweetID = tweet.tweetID;
@ -203,7 +203,8 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> implements View.On
replyName.setVisibility(View.VISIBLE);
}
if(rtFlag) {
userRetweet.setText(retweeter);
String retPrompt = "Retweet "+retweeter;
userRetweet.setText(retPrompt);
userRetweet.setOnClickListener(this);
userRetweet.setVisibility(View.VISIBLE);
}

View File

@ -37,7 +37,7 @@ import twitter4j.conf.ConfigurationBuilder;
public class TwitterEngine {
private final String TWITTER_CONSUMER_KEY = "1JwXJbVrvGWrc9SSKPnnEWslJ";
private final String TWITTER_CONSUMER_SECRET = "4SNMCHbg68LM14X2wYDjWkmzuNqq5dnB7tfAj2b4Muu8uPQ2QE";
private final String TWITTER_CONSUMER_SECRET = "xxx";//TODO
private static TwitterEngine mTwitter;
private static long twitterID = -1L;

View File

@ -68,7 +68,7 @@ public class TimelineRecycler extends Adapter<TimelineRecycler.ItemHolder> imple
@Override
public ItemHolder onCreateViewHolder(ViewGroup parent, int index) {
this.parent = parent;
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.tweet, parent,false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tweet, parent,false);
v.setOnClickListener(this);
return new ItemHolder(v);
}

View File

@ -41,7 +41,7 @@ public class TrendRecycler extends RecyclerView.Adapter<TrendRecycler.ItemHolder
@Override
public ItemHolder onCreateViewHolder(ViewGroup parent, int index) {
this.parent = parent;
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.trend, parent,false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_trend, parent,false);
v.setOnClickListener(this);
return new ItemHolder(v);
}

View File

@ -49,7 +49,7 @@ public class UserRecycler extends RecyclerView.Adapter<UserRecycler.ItemHolder>
@Override
public ItemHolder onCreateViewHolder(ViewGroup parent, int index) {
this.parent = parent;
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.useritem, parent,false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_user, parent,false);
v.setOnClickListener(this);
return new ItemHolder(v);
}

View File

@ -39,7 +39,7 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
@Override
protected void onCreate(Bundle savedInst) {
super.onCreate(savedInst);
setContentView(R.layout.settings);
setContentView(R.layout.settingpage);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_setting);
setSupportActionBar(toolbar);
if(getSupportActionBar() != null)

View File

@ -17,7 +17,7 @@ public class LoginPage extends Activity implements View.OnClickListener {
@Override
protected void onCreate(Bundle b){
super.onCreate(b);
setContentView(R.layout.login);
setContentView(R.layout.loginpage);
pin = findViewById(R.id.pin);
findViewById(R.id.linkButton).setOnClickListener(this);
findViewById(R.id.get).setOnClickListener(this);

View File

@ -36,7 +36,7 @@ public class SearchPage extends AppCompatActivity implements UserRecycler.OnItem
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.search);
setContentView(R.layout.searchpage);
getExtras(getIntent().getExtras());
int background = ColorPreferences.getInstance(this).getColor(ColorPreferences.BACKGROUND);

View File

@ -39,7 +39,7 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.tweet_detail);
setContentView(R.layout.tweetpage);
getExtras(getIntent().getExtras());
boolean home = userID == TwitterEngine.getHomeId();

View File

@ -30,7 +30,7 @@ public class UserDetail extends AppCompatActivity implements UserRecycler.OnItem
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.user);
setContentView(R.layout.userpage);
getExtras(getIntent().getExtras());
userList = (RecyclerView) findViewById(R.id.userlist);

View File

@ -45,7 +45,7 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.profile);
setContentView(R.layout.profilepage);
Toolbar tool = (Toolbar) findViewById(R.id.profile_toolbar);
setSupportActionBar(tool);
if(getSupportActionBar() != null)

View File

@ -16,6 +16,7 @@
android:id="@+id/tweetPb"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/profile_image" />
<LinearLayout
@ -85,7 +86,7 @@
<TextView
android:id="@+id/retweeter"
android:layout_width="150dp"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:singleLine="true"