Fixes issue #198

This commit is contained in:
stom79 2017-12-26 10:06:22 +01:00
parent 76d16fadaa
commit e482789d41
3 changed files with 44 additions and 2 deletions

View File

@ -110,6 +110,15 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
ImageView action_refresh = getSupportActionBar().getCustomView().findViewById(R.id.action_refresh);
title.setText(R.string.conversation);
ImageView close_conversation = getSupportActionBar().getCustomView().findViewById(R.id.close_conversation);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if( lv_status != null) {
lv_status.setAdapter(statusListAdapter);
}
}
});
if( close_conversation != null){
close_conversation.setOnClickListener(new View.OnClickListener() {
@Override
@ -136,6 +145,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
}else{
setTitle(R.string.conversation);
}
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
Account account = new AccountDAO(getApplicationContext(),db).getAccountByID(userId);

View File

@ -15,6 +15,7 @@ package fr.gouv.etalab.mastodon.drawers;
* see <http://www.gnu.org/licenses>. */
import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.os.Handler;
@ -881,6 +882,35 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.main_container.setBackgroundResource(R.color.mastodonC1_);
}
}else {
holder.status_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, ShowConversationActivity.class);
Bundle b = new Bundle();
if( status.getReblog() == null)
b.putString("statusId", status.getId());
else
b.putString("statusId", status.getReblog().getId());
intent.putExtras(b);
context.startActivity(intent);
((ShowConversationActivity)context).finish();
}
});
holder.main_container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, ShowConversationActivity.class);
Bundle b = new Bundle();
if( status.getReblog() == null)
b.putString("statusId", status.getId());
else
b.putString("statusId", status.getReblog().getId());
intent.putExtras(b);
context.startActivity(intent);
((ShowConversationActivity)context).finish();
}
});
if( position == conversationPosition){
if( theme == Helper.THEME_LIGHT)
holder.main_container.setBackgroundResource(R.color.mastodonC3_);

View File

@ -246,9 +246,11 @@
</LinearLayout>
<FrameLayout
android:visibility="gone"
android:layout_gravity="center"
android:id="@+id/status_cardview_video"
android:layout_width="match_parent"
android:layout_height="220dp">
android:layout_width="300dp"
android:layout_height="220dp"
tools:ignore="WebViewLayout">
<WebView
android:id="@+id/status_cardview_webview"
android:layout_width="match_parent"