title and menu to open toot in browser for ViewThreadActivity

This commit is contained in:
Conny Duck 2017-10-28 21:59:33 +02:00
parent 4807493850
commit 671957da5a
16 changed files with 32 additions and 35 deletions

View File

@ -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: {

View File

@ -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. */
}
}

View File

@ -27,8 +27,6 @@ import java.util.Date;
import java.util.List;
public class Status {
private Status actionableStatus;
public String url;
@SerializedName("reblogs_count")

View File

@ -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);
}

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -3,4 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_open_in_web"
android:title="@string/action_open_in_web"
app:showAsAction="never" />
</menu>

View File

@ -23,7 +23,7 @@
<string name="title_notifications">الاشعارات</string>
<string name="title_public_local">المحلية</string>
<string name="title_public_federated">الفدرالية</string>
<string name="title_thread">الخيط</string>
<string name="title_view_thread">الخيط</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">المشاركات</string>
<string name="title_follows">المتابَعون</string>

View File

@ -23,7 +23,7 @@
<string name="title_notifications">Benachrichtigungen</string>
<string name="title_public_local">Lokal</string>
<string name="title_public_federated">Föderiert</string>
<string name="title_thread">Unterhaltung</string>
<string name="title_view_thread">Unterhaltung</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Beiträge</string>
<string name="title_follows">Folgt</string>
@ -199,7 +199,7 @@
<string name="action_copy_link">Link kopieren</string>
<string name="download_image">%1$s heruntergeladen</string>
<string name="dialog_unfollow_warning">Willst du diesem Account wirklich nicht mehr folgen?</string>
<string name="pref_title_alway_show_sensitive_media">NSFW_Inhalte immer anzeigen</string>
<string name="pref_title_alway_show_sensitive_media">NSFW-Inhalte immer anzeigen</string>
<string name="notification_channel_boost_name">Geteilte Beiträge</string>
<string name="notification_channel_boost_description">Benachrichtigungen wenn deine Beiträge geteilt werden</string>
<string name="notification_channel_favourite_description">Benachrichtigungen wenn deine Beiträge favorisiert werden</string>
@ -209,5 +209,4 @@
<string name="notification_channel_mention_descriptions">Benachrichtigungen über neue Erwänungen</string>
<string name="notification_channel_mention_name">Neue Erwähnungen</string>
</resources>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Notifications</string>
<string name="title_public_local">Local</string>
<string name="title_public_federated">Fédéré</string>
<string name="title_thread">Fil</string>
<string name="title_view_thread">Fil</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Pouets</string>
<string name="title_follows">Abonnements</string>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">通知</string>
<string name="title_public_local">ローカル</string>
<string name="title_public_federated">連合</string>
<string name="title_thread">スレッド</string>
<string name="title_view_thread">スレッド</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">投稿</string>
<string name="title_follows">フォロー</string>

View File

@ -21,7 +21,7 @@
<string name="title_notifications">Meldingen</string>
<string name="title_public_local">Lokale tijdlijn</string>
<string name="title_public_federated">Globale tijdlijn</string>
<string name="title_thread">Conversatie</string>
<string name="title_view_thread">Conversatie</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Toots</string>
<string name="title_follows">Volgt</string>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Powiadomienia</string>
<string name="title_public_local">Lokalne</string>
<string name="title_public_federated">Federalne</string>
<string name="title_thread">Wątek</string>
<string name="title_view_thread">Wątek</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Posty</string>
<string name="title_follows">Obserwacje</string>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Notificações</string>
<string name="title_public_local">Local</string>
<string name="title_public_federated">Global</string>
<string name="title_thread">Sequência</string>
<string name="title_view_thread">Sequência</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Postagens</string>
<string name="title_follows">Segue</string>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Уведомления</string>
<string name="title_public_local">Локальная лента</string>
<string name="title_public_federated">Глобальная лента</string>
<string name="title_thread">Тред</string>
<string name="title_view_thread">Тред</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Посты</string>
<string name="title_follows">Подписки</string>

View File

@ -23,7 +23,7 @@
<string name="title_notifications">Bildirimler</string>
<string name="title_public_local">Yerel</string>
<string name="title_public_federated">Birleşmiş</string>
<string name="title_thread">Dizi</string>
<string name="title_view_thread">Dizi</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">İletiler</string>
<string name="title_follows">Takip edilenler</string>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Notifications</string>
<string name="title_public_local">Local</string>
<string name="title_public_federated">Federated</string>
<string name="title_thread">Thread</string>
<string name="title_view_thread">Toot</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Posts</string>
<string name="title_follows">Follows</string>
@ -233,5 +233,4 @@
<string name="follows_you">Follows you</string>
<string name="pref_title_alway_show_sensitive_media">Always show all nsfw content</string>
</resources>