title and menu to open toot in browser for ViewThreadActivity

main
Conny Duck 7 years ago
parent 453b38e89e
commit 64e83bb80c
  1. 4
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
  2. 25
      app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java
  3. 2
      app/src/main/java/com/keylesspalace/tusky/entity/Status.java
  4. 3
      app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java
  5. 5
      app/src/main/res/layout/fragment_view_thread.xml
  6. 4
      app/src/main/res/menu/view_thread_toolbar.xml
  7. 2
      app/src/main/res/values-ar/strings.xml
  8. 5
      app/src/main/res/values-de/strings.xml
  9. 2
      app/src/main/res/values-fr/strings.xml
  10. 2
      app/src/main/res/values-ja/strings.xml
  11. 2
      app/src/main/res/values-nl/strings.xml
  12. 2
      app/src/main/res/values-pl/strings.xml
  13. 2
      app/src/main/res/values-pt-rBR/strings.xml
  14. 2
      app/src/main/res/values-ru/strings.xml
  15. 2
      app/src/main/res/values-tr/strings.xml
  16. 3
      app/src/main/res/values/strings.xml

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

@ -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"

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save