mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-29 02:19:35 +01:00
small bugfix
This commit is contained in:
parent
78a605a498
commit
37fe57444e
@ -190,7 +190,7 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Long mode) {
|
||||
TweetDetail connect = ui.get();
|
||||
final TweetDetail connect = ui.get();
|
||||
if(connect == null)
|
||||
return;
|
||||
|
||||
@ -251,7 +251,7 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
mediaButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
new ImagePopup(ui.get()).execute(medialinks);
|
||||
connect.onMediaClicked(medialinks);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -401,4 +401,8 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
else
|
||||
retweetButton.setBackgroundResource(R.drawable.retweet);
|
||||
}
|
||||
|
||||
public interface OnMediaClick {
|
||||
void onMediaClicked(String medialinks[]);
|
||||
}
|
||||
}
|
@ -87,7 +87,7 @@ public class SearchPage extends AppCompatActivity implements UserRecycler.OnItem
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
if (mSearch != null && mSearch.isCancelled()) {
|
||||
if (mSearch != null && !mSearch.isCancelled()) {
|
||||
mSearch.cancel(true);
|
||||
tweetReload.setRefreshing(false);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import android.widget.Toast;
|
||||
|
||||
import org.nuclearfog.twidda.R;
|
||||
import org.nuclearfog.twidda.backend.GlobalSettings;
|
||||
import org.nuclearfog.twidda.backend.ImagePopup;
|
||||
import org.nuclearfog.twidda.backend.StatusLoader;
|
||||
import org.nuclearfog.twidda.backend.listitems.Tweet;
|
||||
import org.nuclearfog.twidda.viewadapter.TimelineRecycler;
|
||||
@ -34,10 +35,11 @@ import static android.content.DialogInterface.BUTTON_POSITIVE;
|
||||
* @see StatusLoader
|
||||
*/
|
||||
public class TweetDetail extends AppCompatActivity implements OnClickListener,
|
||||
OnItemClicked, DialogInterface.OnClickListener, OnRefreshListener {
|
||||
OnItemClicked, DialogInterface.OnClickListener, OnRefreshListener, StatusLoader.OnMediaClick {
|
||||
|
||||
private RecyclerView answer_list;
|
||||
private StatusLoader mStat, mReply;
|
||||
private ImagePopup mediaContent;
|
||||
private SwipeRefreshLayout answerReload;
|
||||
private ConnectivityManager mConnect;
|
||||
private GlobalSettings settings;
|
||||
@ -89,13 +91,16 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
if (mStat != null && mStat.isCancelled()) {
|
||||
if (mStat != null && !mStat.isCancelled()) {
|
||||
mStat.cancel(true);
|
||||
}
|
||||
if (mReply != null && mReply.isCancelled()) {
|
||||
if (mReply != null && !mReply.isCancelled()) {
|
||||
mReply.cancel(true);
|
||||
answerReload.setRefreshing(false);
|
||||
}
|
||||
if (mediaContent != null && !mediaContent.isCancelled()) {
|
||||
mediaContent.cancel(true);
|
||||
}
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@ -202,6 +207,12 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
|
||||
mReply.execute(tweetID, StatusLoader.LOAD_REPLY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMediaClicked(String mediaLinks[]) {
|
||||
mediaContent = new ImagePopup(this);
|
||||
mediaContent.execute(mediaLinks);
|
||||
}
|
||||
|
||||
private void setContent() {
|
||||
int backgroundColor = settings.getBackgroundColor();
|
||||
int fontColor = settings.getFontColor();
|
||||
|
@ -51,7 +51,7 @@ public class UserDetail extends AppCompatActivity implements OnItemClicked {
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
if (uList != null && uList.isCancelled()) {
|
||||
if (uList != null && !uList.isCancelled()) {
|
||||
uList.cancel(true);
|
||||
}
|
||||
super.onPause();
|
||||
|
Loading…
x
Reference in New Issue
Block a user