title and menu to open toot in browser for ViewThreadActivity
This commit is contained in:
parent
4807493850
commit
671957da5a
16 changed files with 32 additions and 35 deletions
|
@ -678,9 +678,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
|
|||
// If the account isn't loaded yet, eat the input.
|
||||
return false;
|
||||
}
|
||||
Uri uri = Uri.parse(loadedAccount.url);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
startActivity(intent);
|
||||
LinkHelper.openLink(loadedAccount.url, this);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_follow: {
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
package com.keylesspalace.tusky;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -26,6 +27,7 @@ import android.view.Menu;
|
|||
import android.view.MenuItem;
|
||||
|
||||
import com.keylesspalace.tusky.fragment.ViewThreadFragment;
|
||||
import com.keylesspalace.tusky.util.LinkHelper;
|
||||
|
||||
public class ViewThreadActivity extends BaseActivity {
|
||||
@Override
|
||||
|
@ -35,11 +37,11 @@ public class ViewThreadActivity extends BaseActivity {
|
|||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar bar = getSupportActionBar();
|
||||
if (bar != null) {
|
||||
bar.setTitle(null);
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
bar.setDisplayShowHomeEnabled(true);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(R.string.title_view_thread);
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
String id = getIntent().getStringExtra("id");
|
||||
|
@ -62,14 +64,11 @@ public class ViewThreadActivity extends BaseActivity {
|
|||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_in_web: {
|
||||
LinkHelper.openLink(getIntent().getStringExtra("url"), this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
/* Provide a stub to ignore configuration changes so the thread isn't reloaded when the
|
||||
* the activity is reoriented or resized. */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
public class Status {
|
||||
private Status actionableStatus;
|
||||
|
||||
public String url;
|
||||
|
||||
@SerializedName("reblogs_count")
|
||||
|
|
|
@ -294,7 +294,8 @@ public abstract class SFragment extends BaseFragment implements AdapterItemRemov
|
|||
|
||||
protected void viewThread(Status status) {
|
||||
Intent intent = new Intent(getContext(), ViewThreadActivity.class);
|
||||
intent.putExtra("id", status.getActionableId());
|
||||
intent.putExtra("id", status.id);
|
||||
intent.putExtra("url", status.url);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue