diff --git a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java index 91b05a321..0dbfdf137 100644 --- a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; @@ -41,7 +42,7 @@ import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; -public class LoginActivity extends BaseActivity { +public class LoginActivity extends AppCompatActivity { private static final String TAG = "LoginActivity"; // logging tag private static String OAUTH_SCOPES = "read write follow"; diff --git a/app/src/main/java/com/keylesspalace/tusky/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/SFragment.java index 967a0e033..3dacaebab 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/SFragment.java @@ -19,7 +19,6 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.provider.ContactsContract; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentTransaction; @@ -74,7 +73,7 @@ public class SFragment extends BaseFragment { mentionedUsernames.remove(loggedInUsername); Intent intent = new Intent(getContext(), ComposeActivity.class); intent.putExtra("in_reply_to_id", inReplyToId); - intent.putExtra("reply_visibility", status.visibility.toString().toLowerCase()); + intent.putExtra("reply_visibility", status.getVisibility().toString().toLowerCase()); intent.putExtra("mentioned_usernames", mentionedUsernames.toArray(new String[0])); startActivity(intent); } diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/ViewThreadFragment.java index 11120541b..df35e88f8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewThreadFragment.java @@ -125,15 +125,18 @@ public class ViewThreadFragment extends SFragment implements StatusActionListene } private void onThreadRequestFailure(final String id) { - Snackbar.make(recyclerView, R.string.error_view_thread, Snackbar.LENGTH_LONG) - .setAction(R.string.action_retry, new View.OnClickListener() { - @Override - public void onClick(View v) { - sendThreadRequest(id); - sendStatusRequest(id); - } - }) - .show(); + View view = getView(); + if (view != null) { + Snackbar.make(view, R.string.error_view_thread, Snackbar.LENGTH_LONG) + .setAction(R.string.action_retry, new View.OnClickListener() { + @Override + public void onClick(View v) { + sendThreadRequest(id); + sendStatusRequest(id); + } + }) + .show(); + } } public void onReply(int position) { diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Status.java b/app/src/main/java/com/keylesspalace/tusky/entity/Status.java index 39378ee98..2e354da6b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Status.java +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Status.java @@ -77,6 +77,10 @@ public class Status { public Visibility visibility; + public Visibility getVisibility() { + return visibility == null ? Visibility.UNLISTED : visibility; + } + @SerializedName("media_attachments") public MediaAttachment[] attachments;