Merge branch 'Gargron-master'
This commit is contained in:
commit
dc75939d50
40 changed files with 2423 additions and 423 deletions
|
@ -21,7 +21,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
|
|
1862
app/src/main/java/com/emojione/Emojione.java
Normal file
1862
app/src/main/java/com/emojione/Emojione.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -229,7 +229,7 @@ public class AccountActivity extends BaseActivity {
|
||||||
if (!account.header.isEmpty()) {
|
if (!account.header.isEmpty()) {
|
||||||
Picasso.with(this)
|
Picasso.with(this)
|
||||||
.load(account.header)
|
.load(account.header)
|
||||||
.placeholder(R.drawable.account_header_default)
|
.placeholder(R.drawable.account_header_missing)
|
||||||
.into(header);
|
.into(header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
package com.keylesspalace.tusky;
|
package com.keylesspalace.tusky;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -38,6 +39,26 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish() {
|
||||||
|
super.finish();
|
||||||
|
overridePendingTransitionExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActivity(Intent intent) {
|
||||||
|
super.startActivity(intent);
|
||||||
|
overridePendingTransitionEnter();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void overridePendingTransitionEnter() {
|
||||||
|
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void overridePendingTransitionExit() {
|
||||||
|
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
TypedValue value = new TypedValue();
|
TypedValue value = new TypedValue();
|
||||||
|
|
|
@ -66,9 +66,6 @@ class BlocksAdapter extends AccountAdapter {
|
||||||
} else {
|
} else {
|
||||||
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
||||||
holder.setState(footerState);
|
holder.setState(footerState);
|
||||||
holder.setupButton(footerActionListener);
|
|
||||||
holder.setRetryMessage(R.string.footer_retry_accounts);
|
|
||||||
holder.setEndOfTimelineMessage(R.string.footer_end_of_accounts);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,15 @@ import android.support.annotation.DrawableRes;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v13.view.inputmethod.EditorInfoCompat;
|
import android.support.v13.view.inputmethod.EditorInfoCompat;
|
||||||
import android.support.v13.view.inputmethod.InputConnectionCompat;
|
import android.support.v13.view.inputmethod.InputConnectionCompat;
|
||||||
import android.support.v13.view.inputmethod.InputContentInfoCompat;
|
import android.support.v13.view.inputmethod.InputContentInfoCompat;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
|
@ -55,6 +58,8 @@ import android.text.Spanned;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
@ -105,7 +110,6 @@ public class ComposeActivity extends BaseActivity {
|
||||||
private String domain;
|
private String domain;
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
private EditText textEditor;
|
private EditText textEditor;
|
||||||
private ImageButton mediaPick;
|
|
||||||
private LinearLayout mediaPreviewBar;
|
private LinearLayout mediaPreviewBar;
|
||||||
private ArrayList<QueuedMedia> mediaQueued;
|
private ArrayList<QueuedMedia> mediaQueued;
|
||||||
private CountUpDownLatch waitForMediaLatch;
|
private CountUpDownLatch waitForMediaLatch;
|
||||||
|
@ -118,6 +122,8 @@ public class ComposeActivity extends BaseActivity {
|
||||||
private InputContentInfoCompat currentInputContentInfo;
|
private InputContentInfoCompat currentInputContentInfo;
|
||||||
private int currentFlags;
|
private int currentFlags;
|
||||||
private ProgressDialog finishingUploadDialog;
|
private ProgressDialog finishingUploadDialog;
|
||||||
|
private EditText contentWarningEditor;
|
||||||
|
private boolean mediaPickEnabled;
|
||||||
|
|
||||||
private static class QueuedMedia {
|
private static class QueuedMedia {
|
||||||
enum Type {
|
enum Type {
|
||||||
|
@ -317,9 +323,30 @@ public class ComposeActivity extends BaseActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_compose);
|
setContentView(R.layout.activity_compose);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setTitle(null);
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setDisplayShowHomeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
SharedPreferences preferences = getSharedPreferences(
|
SharedPreferences preferences = getSharedPreferences(
|
||||||
getString(R.string.preferences_file_key), Context.MODE_PRIVATE);
|
getString(R.string.preferences_file_key), Context.MODE_PRIVATE);
|
||||||
|
|
||||||
|
mediaPickEnabled = true;
|
||||||
|
|
||||||
|
FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
|
||||||
|
floatingBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
sendStatus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ArrayList<SavedQueuedMedia> savedMediaQueued = null;
|
ArrayList<SavedQueuedMedia> savedMediaQueued = null;
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
showMarkSensitive = savedInstanceState.getBoolean("showMarkSensitive");
|
showMarkSensitive = savedInstanceState.getBoolean("showMarkSensitive");
|
||||||
|
@ -399,77 +426,10 @@ public class ComposeActivity extends BaseActivity {
|
||||||
waitForMediaLatch = new CountUpDownLatch();
|
waitForMediaLatch = new CountUpDownLatch();
|
||||||
|
|
||||||
contentWarningBar = findViewById(R.id.compose_content_warning_bar);
|
contentWarningBar = findViewById(R.id.compose_content_warning_bar);
|
||||||
@DrawableRes int drawableId = ThemeUtils.getDrawableId(this,
|
contentWarningEditor = (EditText) findViewById(R.id.field_content_warning);
|
||||||
R.attr.compose_content_warning_bar_background, R.drawable.border_background_dark);
|
|
||||||
contentWarningBar.setBackgroundResource(drawableId);
|
|
||||||
final EditText contentWarningEditor = (EditText) findViewById(R.id.field_content_warning);
|
|
||||||
showContentWarning(false);
|
showContentWarning(false);
|
||||||
|
|
||||||
statusAlreadyInFlight = false;
|
statusAlreadyInFlight = false;
|
||||||
final Button sendButton = (Button) findViewById(R.id.button_send);
|
|
||||||
sendButton.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (statusAlreadyInFlight) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Editable editable = textEditor.getText();
|
|
||||||
if (editable.length() <= STATUS_CHARACTER_LIMIT) {
|
|
||||||
statusAlreadyInFlight = true;
|
|
||||||
String spoilerText = "";
|
|
||||||
if (statusHideText) {
|
|
||||||
spoilerText = contentWarningEditor.getText().toString();
|
|
||||||
}
|
|
||||||
readyStatus(editable.toString(), statusVisibility, statusMarkSensitive,
|
|
||||||
spoilerText);
|
|
||||||
} else {
|
|
||||||
textEditor.setError(getString(R.string.error_compose_character_limit));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mediaPick = (ImageButton) findViewById(R.id.compose_photo_pick);
|
|
||||||
mediaPick.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
onMediaPick();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ImageButton options = (ImageButton) findViewById(R.id.compose_options);
|
|
||||||
options.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
ComposeOptionsFragment fragment = ComposeOptionsFragment.newInstance(
|
|
||||||
statusVisibility, statusMarkSensitive, statusHideText,
|
|
||||||
showMarkSensitive, inReplyToId != null,
|
|
||||||
new ComposeOptionsFragment.Listener() {
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onVisibilityChanged(String visibility) {
|
|
||||||
statusVisibility = visibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMarkSensitiveChanged(boolean markSensitive) {
|
|
||||||
statusMarkSensitive = markSensitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onContentWarningChanged(boolean hideText) {
|
|
||||||
showContentWarning(hideText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
fragment.show(getSupportFragmentManager(), null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// These can only be added after everything affected by the media queue is initialized.
|
// These can only be added after everything affected by the media queue is initialized.
|
||||||
if (savedMediaQueued != null) {
|
if (savedMediaQueued != null) {
|
||||||
|
@ -479,6 +439,55 @@ public class ComposeActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showComposeOptions() {
|
||||||
|
ComposeOptionsFragment fragment = ComposeOptionsFragment.newInstance(
|
||||||
|
statusVisibility, statusMarkSensitive, statusHideText,
|
||||||
|
showMarkSensitive, inReplyToId != null,
|
||||||
|
new ComposeOptionsFragment.Listener() {
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onVisibilityChanged(String visibility) {
|
||||||
|
statusVisibility = visibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMarkSensitiveChanged(boolean markSensitive) {
|
||||||
|
statusMarkSensitive = markSensitive;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContentWarningChanged(boolean hideText) {
|
||||||
|
showContentWarning(hideText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fragment.show(getSupportFragmentManager(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendStatus() {
|
||||||
|
if (statusAlreadyInFlight) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Editable editable = textEditor.getText();
|
||||||
|
if (editable.length() <= STATUS_CHARACTER_LIMIT) {
|
||||||
|
statusAlreadyInFlight = true;
|
||||||
|
String spoilerText = "";
|
||||||
|
if (statusHideText) {
|
||||||
|
spoilerText = contentWarningEditor.getText().toString();
|
||||||
|
}
|
||||||
|
readyStatus(editable.toString(), statusVisibility, statusMarkSensitive,
|
||||||
|
spoilerText);
|
||||||
|
} else {
|
||||||
|
textEditor.setError(getString(R.string.error_compose_character_limit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
ArrayList<SavedQueuedMedia> savedMediaQueued = new ArrayList<>();
|
ArrayList<SavedQueuedMedia> savedMediaQueued = new ArrayList<>();
|
||||||
|
@ -530,7 +539,7 @@ public class ComposeActivity extends BaseActivity {
|
||||||
} else {
|
} else {
|
||||||
mimeTypes = Arrays.copyOf(contentMimeTypes, contentMimeTypes.length);
|
mimeTypes = Arrays.copyOf(contentMimeTypes, contentMimeTypes.length);
|
||||||
}
|
}
|
||||||
EditText editText = new EditText(this) {
|
EditText editText = new android.support.v7.widget.AppCompatEditText(this) {
|
||||||
@Override
|
@Override
|
||||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||||
final InputConnection ic = super.onCreateInputConnection(editorInfo);
|
final InputConnection ic = super.onCreateInputConnection(editorInfo);
|
||||||
|
@ -783,15 +792,24 @@ public class ComposeActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableMediaPicking() {
|
private void enableMediaPicking() {
|
||||||
mediaPick.setEnabled(true);
|
mediaPickEnabled = true;
|
||||||
ThemeUtils.setImageViewTint(mediaPick, R.attr.compose_media_button_tint);
|
invalidateOptionsMenu();
|
||||||
mediaPick.setImageResource(R.drawable.ic_media);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disableMediaPicking() {
|
private void disableMediaPicking() {
|
||||||
mediaPick.setEnabled(false);
|
mediaPickEnabled = false;
|
||||||
ThemeUtils.setImageViewTint(mediaPick, R.attr.compose_media_button_disabled_tint);
|
invalidateOptionsMenu();
|
||||||
mediaPick.setImageResource(R.drawable.ic_media_disabled);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
|
if (mediaPickEnabled) {
|
||||||
|
menu.findItem(R.id.compose_photo_pick).setEnabled(true);
|
||||||
|
} else {
|
||||||
|
menu.findItem(R.id.compose_photo_pick).setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onPrepareOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addMediaToQueue(QueuedMedia.Type type, Bitmap preview, Uri uri, long mediaSize) {
|
private void addMediaToQueue(QueuedMedia.Type type, Bitmap preview, Uri uri, long mediaSize) {
|
||||||
|
@ -1103,4 +1121,32 @@ public class ComposeActivity extends BaseActivity {
|
||||||
contentWarningBar.setVisibility(View.GONE);
|
contentWarningBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.compose_toolbar, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home: {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
case R.id.compose_photo_pick: {
|
||||||
|
onMediaPick();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
case R.id.compose_options: {
|
||||||
|
showComposeOptions();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,12 @@ import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.volley.toolbox.ImageLoader;
|
import com.android.volley.toolbox.ImageLoader;
|
||||||
import com.android.volley.toolbox.NetworkImageView;
|
import com.android.volley.toolbox.NetworkImageView;
|
||||||
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
/** Both for follows and following lists. */
|
/** Both for follows and following lists. */
|
||||||
class FollowAdapter extends AccountAdapter {
|
class FollowAdapter extends AccountAdapter {
|
||||||
|
@ -61,9 +63,6 @@ class FollowAdapter extends AccountAdapter {
|
||||||
} else {
|
} else {
|
||||||
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
||||||
holder.setState(footerState);
|
holder.setState(footerState);
|
||||||
holder.setupButton(footerActionListener);
|
|
||||||
holder.setRetryMessage(R.string.footer_retry_accounts);
|
|
||||||
holder.setEndOfTimelineMessage(R.string.footer_end_of_accounts);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +80,7 @@ class FollowAdapter extends AccountAdapter {
|
||||||
private TextView username;
|
private TextView username;
|
||||||
private TextView displayName;
|
private TextView displayName;
|
||||||
private TextView note;
|
private TextView note;
|
||||||
private NetworkImageView avatar;
|
private ImageView avatar;
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
AccountViewHolder(View itemView) {
|
AccountViewHolder(View itemView) {
|
||||||
|
@ -90,9 +89,7 @@ class FollowAdapter extends AccountAdapter {
|
||||||
username = (TextView) itemView.findViewById(R.id.account_username);
|
username = (TextView) itemView.findViewById(R.id.account_username);
|
||||||
displayName = (TextView) itemView.findViewById(R.id.account_display_name);
|
displayName = (TextView) itemView.findViewById(R.id.account_display_name);
|
||||||
note = (TextView) itemView.findViewById(R.id.account_note);
|
note = (TextView) itemView.findViewById(R.id.account_note);
|
||||||
avatar = (NetworkImageView) itemView.findViewById(R.id.account_avatar);
|
avatar = (ImageView) itemView.findViewById(R.id.account_avatar);
|
||||||
avatar.setDefaultImageResId(R.drawable.avatar_default);
|
|
||||||
avatar.setErrorImageResId(R.drawable.avatar_error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupWithAccount(Account account) {
|
void setupWithAccount(Account account) {
|
||||||
|
@ -103,8 +100,11 @@ class FollowAdapter extends AccountAdapter {
|
||||||
displayName.setText(account.displayName);
|
displayName.setText(account.displayName);
|
||||||
note.setText(account.note);
|
note.setText(account.note);
|
||||||
Context context = avatar.getContext();
|
Context context = avatar.getContext();
|
||||||
ImageLoader imageLoader = VolleySingleton.getInstance(context).getImageLoader();
|
Picasso.with(context)
|
||||||
avatar.setImageUrl(account.avatar, imageLoader);
|
.load(account.avatar)
|
||||||
|
.placeholder(R.drawable.avatar_default)
|
||||||
|
.error(R.drawable.avatar_error)
|
||||||
|
.into(avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupActionListener(final AccountActionListener listener) {
|
void setupActionListener(final AccountActionListener listener) {
|
||||||
|
|
|
@ -22,11 +22,7 @@ import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
class FooterViewHolder extends RecyclerView.ViewHolder {
|
class FooterViewHolder extends RecyclerView.ViewHolder {
|
||||||
private View retryBar;
|
|
||||||
private TextView retryMessage;
|
|
||||||
private Button retry;
|
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView endOfTimelineMessage;
|
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
LOADING,
|
LOADING,
|
||||||
|
@ -36,49 +32,22 @@ class FooterViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
FooterViewHolder(View itemView) {
|
FooterViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
retryBar = itemView.findViewById(R.id.footer_retry_bar);
|
|
||||||
retryMessage = (TextView) itemView.findViewById(R.id.footer_retry_message);
|
|
||||||
retry = (Button) itemView.findViewById(R.id.footer_retry_button);
|
|
||||||
progressBar = (ProgressBar) itemView.findViewById(R.id.footer_progress_bar);
|
progressBar = (ProgressBar) itemView.findViewById(R.id.footer_progress_bar);
|
||||||
progressBar.setIndeterminate(true);
|
progressBar.setIndeterminate(true);
|
||||||
endOfTimelineMessage = (TextView) itemView.findViewById(R.id.footer_end_of_timeline_text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupButton(final FooterActionListener listener) {
|
|
||||||
retry.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
listener.onLoadMore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void setRetryMessage(int messageId) {
|
|
||||||
retryMessage.setText(messageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setEndOfTimelineMessage(int messageId) {
|
|
||||||
endOfTimelineMessage.setText(messageId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setState(State state) {
|
void setState(State state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case LOADING: {
|
case LOADING: {
|
||||||
retryBar.setVisibility(View.GONE);
|
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
endOfTimelineMessage.setVisibility(View.GONE);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RETRY: {
|
case RETRY: {
|
||||||
retryBar.setVisibility(View.VISIBLE);
|
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
endOfTimelineMessage.setVisibility(View.GONE);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case END_OF_TIMELINE: {
|
case END_OF_TIMELINE: {
|
||||||
retryBar.setVisibility(View.GONE);
|
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
endOfTimelineMessage.setVisibility(View.VISIBLE);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,12 @@ import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.volley.Request;
|
import com.android.volley.Request;
|
||||||
|
@ -48,6 +50,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
private String domain;
|
private String domain;
|
||||||
private String clientId;
|
private String clientId;
|
||||||
private String clientSecret;
|
private String clientSecret;
|
||||||
|
private EditText editText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chain together the key-value pairs into a query string, for either appending to a URL or
|
* Chain together the key-value pairs into a query string, for either appending to a URL or
|
||||||
|
@ -173,7 +176,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
preferences = getSharedPreferences(
|
preferences = getSharedPreferences(
|
||||||
getString(R.string.preferences_file_key), Context.MODE_PRIVATE);
|
getString(R.string.preferences_file_key), Context.MODE_PRIVATE);
|
||||||
Button button = (Button) findViewById(R.id.button_login);
|
Button button = (Button) findViewById(R.id.button_login);
|
||||||
final EditText editText = (EditText) findViewById(R.id.edit_text_domain);
|
editText = (EditText) findViewById(R.id.edit_text_domain);
|
||||||
button.setOnClickListener(new View.OnClickListener() {
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -273,7 +276,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
try {
|
try {
|
||||||
accessToken = response.getString("access_token");
|
accessToken = response.getString("access_token");
|
||||||
} catch(JSONException e) {
|
} catch(JSONException e) {
|
||||||
errorText.setText(e.getMessage());
|
editText.setError(e.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
onLoginSuccess(accessToken);
|
onLoginSuccess(accessToken);
|
||||||
|
@ -281,7 +284,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
}, new Response.ErrorListener() {
|
}, new Response.ErrorListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onErrorResponse(VolleyError error) {
|
public void onErrorResponse(VolleyError error) {
|
||||||
errorText.setText(error.getMessage());
|
editText.setError(error.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
VolleySingleton.getInstance(this).addToRequestQueue(request);
|
VolleySingleton.getInstance(this).addToRequestQueue(request);
|
||||||
|
|
|
@ -21,13 +21,17 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.annotation.RequiresApi;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.TabLayout;
|
import android.support.design.widget.TabLayout;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.transition.Slide;
|
||||||
|
import android.transition.TransitionInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -43,6 +47,7 @@ import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
public class MainActivity extends BaseActivity {
|
public class MainActivity extends BaseActivity {
|
||||||
private static final String TAG = "MainActivity"; // logging tag and Volley request tag
|
private static final String TAG = "MainActivity"; // logging tag and Volley request tag
|
||||||
|
@ -52,6 +57,8 @@ public class MainActivity extends BaseActivity {
|
||||||
private boolean notificationServiceEnabled;
|
private boolean notificationServiceEnabled;
|
||||||
private String loggedInAccountId;
|
private String loggedInAccountId;
|
||||||
private String loggedInAccountUsername;
|
private String loggedInAccountUsername;
|
||||||
|
Stack<Integer> pageHistory = new Stack<Integer>();
|
||||||
|
private ViewPager viewPager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -81,16 +88,44 @@ public class MainActivity extends BaseActivity {
|
||||||
getString(R.string.title_public)
|
getString(R.string.title_public)
|
||||||
};
|
};
|
||||||
adapter.setPageTitles(pageTitles);
|
adapter.setPageTitles(pageTitles);
|
||||||
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
|
viewPager = (ViewPager) findViewById(R.id.pager);
|
||||||
int pageMargin = getResources().getDimensionPixelSize(R.dimen.tab_page_margin);
|
int pageMargin = getResources().getDimensionPixelSize(R.dimen.tab_page_margin);
|
||||||
viewPager.setPageMargin(pageMargin);
|
viewPager.setPageMargin(pageMargin);
|
||||||
Drawable pageMarginDrawable = ThemeUtils.getDrawable(this, R.attr.tab_page_margin_drawable,
|
Drawable pageMarginDrawable = ThemeUtils.getDrawable(this, R.attr.tab_page_margin_drawable,
|
||||||
R.drawable.tab_page_margin_dark);
|
R.drawable.tab_page_margin_dark);
|
||||||
viewPager.setPageMarginDrawable(pageMarginDrawable);
|
viewPager.setPageMarginDrawable(pageMarginDrawable);
|
||||||
viewPager.setAdapter(adapter);
|
viewPager.setAdapter(adapter);
|
||||||
|
|
||||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
|
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
|
||||||
tabLayout.setupWithViewPager(viewPager);
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
|
|
||||||
|
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
viewPager.setCurrentItem(tab.getPosition());
|
||||||
|
|
||||||
|
if (pageHistory.empty()) {
|
||||||
|
pageHistory.push(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageHistory.contains(tab.getPosition())) {
|
||||||
|
pageHistory.remove(pageHistory.indexOf(tab.getPosition()));
|
||||||
|
}
|
||||||
|
|
||||||
|
pageHistory.push(tab.getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Retrieve notification update preference.
|
// Retrieve notification update preference.
|
||||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
notificationServiceEnabled = preferences.getBoolean("pullNotifications", true);
|
notificationServiceEnabled = preferences.getBoolean("pullNotifications", true);
|
||||||
|
@ -218,6 +253,17 @@ public class MainActivity extends BaseActivity {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if(pageHistory.empty()) {
|
||||||
|
super.onBackPressed();
|
||||||
|
} else {
|
||||||
|
pageHistory.pop();
|
||||||
|
viewPager.setCurrentItem(pageHistory.lastElement());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,13 @@
|
||||||
package com.keylesspalace.tusky;
|
package com.keylesspalace.tusky;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.media.Image;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.SpannableStringBuilder;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -26,6 +31,7 @@ import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.volley.toolbox.NetworkImageView;
|
import com.android.volley.toolbox.NetworkImageView;
|
||||||
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -110,9 +116,6 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
||||||
} else {
|
} else {
|
||||||
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
||||||
holder.setState(footerState);
|
holder.setState(footerState);
|
||||||
holder.setupButton(footerListener);
|
|
||||||
holder.setRetryMessage(R.string.footer_retry_notifications);
|
|
||||||
holder.setEndOfTimelineMessage(R.string.footer_end_of_notifications);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,18 +196,14 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
||||||
private TextView message;
|
private TextView message;
|
||||||
private TextView usernameView;
|
private TextView usernameView;
|
||||||
private TextView displayNameView;
|
private TextView displayNameView;
|
||||||
private NetworkImageView avatar;
|
private ImageView avatar;
|
||||||
private Button follow;
|
|
||||||
|
|
||||||
FollowViewHolder(View itemView) {
|
FollowViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
message = (TextView) itemView.findViewById(R.id.notification_text);
|
message = (TextView) itemView.findViewById(R.id.notification_text);
|
||||||
usernameView = (TextView) itemView.findViewById(R.id.notification_username);
|
usernameView = (TextView) itemView.findViewById(R.id.notification_username);
|
||||||
displayNameView = (TextView) itemView.findViewById(R.id.notification_display_name);
|
displayNameView = (TextView) itemView.findViewById(R.id.notification_display_name);
|
||||||
avatar = (NetworkImageView) itemView.findViewById(R.id.notification_avatar);
|
avatar = (ImageView) itemView.findViewById(R.id.notification_avatar);
|
||||||
avatar.setDefaultImageResId(R.drawable.avatar_default);
|
|
||||||
avatar.setErrorImageResId(R.drawable.avatar_error);
|
|
||||||
follow = (Button) itemView.findViewById(R.id.notification_follow_button);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMessage(String displayName, String username, String avatarUrl) {
|
void setMessage(String displayName, String username, String avatarUrl) {
|
||||||
|
@ -220,7 +219,11 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
||||||
|
|
||||||
displayNameView.setText(displayName);
|
displayNameView.setText(displayName);
|
||||||
|
|
||||||
avatar.setImageUrl(avatarUrl, VolleySingleton.getInstance(context).getImageLoader());
|
Picasso.with(context)
|
||||||
|
.load(avatarUrl)
|
||||||
|
.placeholder(R.drawable.avatar_default)
|
||||||
|
.error(R.drawable.avatar_error)
|
||||||
|
.into(avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupButtons(final FollowListener listener, final String accountId) {
|
void setupButtons(final FollowListener listener, final String accountId) {
|
||||||
|
@ -230,12 +233,6 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
||||||
listener.onViewAccount(accountId);
|
listener.onViewAccount(accountId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
follow.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
listener.onFollow(accountId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,22 +254,22 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
|
||||||
switch (type) {
|
switch (type) {
|
||||||
default:
|
default:
|
||||||
case FAVOURITE: {
|
case FAVOURITE: {
|
||||||
icon.setImageResource(R.drawable.ic_favourited);
|
icon.setImageResource(R.drawable.ic_star_24dp);
|
||||||
|
icon.setColorFilter(ContextCompat.getColor(context, R.color.status_favourite_button_marked_dark));
|
||||||
format = context.getString(R.string.notification_favourite_format);
|
format = context.getString(R.string.notification_favourite_format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case REBLOG: {
|
case REBLOG: {
|
||||||
icon.setImageResource(R.drawable.ic_reblogged);
|
icon.setImageResource(R.drawable.ic_repeat_24dp);
|
||||||
|
icon.setColorFilter(ContextCompat.getColor(context, R.color.color_accent_dark));
|
||||||
format = context.getString(R.string.notification_reblog_format);
|
format = context.getString(R.string.notification_reblog_format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String wholeMessage = String.format(format, displayName);
|
String wholeMessage = String.format(format, displayName);
|
||||||
message.setText(wholeMessage);
|
final SpannableStringBuilder str = new SpannableStringBuilder(wholeMessage);
|
||||||
String timestamp = DateUtils.getRelativeTimeSpanString(
|
str.setSpan(new android.text.style.StyleSpan(Typeface.BOLD), 0, displayName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
status.getCreatedAt().getTime(),
|
message.setText(str);
|
||||||
new Date().getTime());
|
|
||||||
statusContent.setText(String.format("%s: ", timestamp));
|
|
||||||
statusContent.append(status.getContent());
|
statusContent.append(status.getContent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,8 +280,14 @@ public class SFragment extends Fragment {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActivity(Intent intent) {
|
||||||
|
super.startActivity(intent);
|
||||||
|
getActivity().overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||||
|
}
|
||||||
|
|
||||||
protected void openReportPage(String accountId, String accountUsername, String statusId,
|
protected void openReportPage(String accountId, String accountUsername, String statusId,
|
||||||
Spanned statusContent) {
|
Spanned statusContent) {
|
||||||
Intent intent = new Intent(getContext(), ReportActivity.class);
|
Intent intent = new Intent(getContext(), ReportActivity.class);
|
||||||
intent.putExtra("account_id", accountId);
|
intent.putExtra("account_id", accountId);
|
||||||
intent.putExtra("account_username", accountUsername);
|
intent.putExtra("account_username", accountUsername);
|
||||||
|
|
|
@ -18,6 +18,8 @@ package com.keylesspalace.tusky;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
|
|
||||||
|
import com.emojione.Emojione;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -273,7 +275,7 @@ public class Status {
|
||||||
status = reblog;
|
status = reblog;
|
||||||
status.setRebloggedByDisplayName(displayName);
|
status.setRebloggedByDisplayName(displayName);
|
||||||
} else {
|
} else {
|
||||||
Spanned contentPlus = HtmlUtils.fromHtml(content);
|
Spanned contentPlus = HtmlUtils.fromHtml(Emojione.shortnameToUnicode(content, false));
|
||||||
status = new Status(
|
status = new Status(
|
||||||
id, accountId, displayName, username, contentPlus, avatar, createdAt,
|
id, accountId, displayName, username, contentPlus, avatar, createdAt,
|
||||||
reblogged, favourited, visibility);
|
reblogged, favourited, visibility);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
package com.keylesspalace.tusky;
|
package com.keylesspalace.tusky;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.media.Image;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
|
@ -51,10 +52,10 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
private ImageButton moreButton;
|
private ImageButton moreButton;
|
||||||
private boolean favourited;
|
private boolean favourited;
|
||||||
private boolean reblogged;
|
private boolean reblogged;
|
||||||
private NetworkImageView mediaPreview0;
|
private ImageView mediaPreview0;
|
||||||
private NetworkImageView mediaPreview1;
|
private ImageView mediaPreview1;
|
||||||
private NetworkImageView mediaPreview2;
|
private ImageView mediaPreview2;
|
||||||
private NetworkImageView mediaPreview3;
|
private ImageView mediaPreview3;
|
||||||
private View sensitiveMediaWarning;
|
private View sensitiveMediaWarning;
|
||||||
private View contentWarningBar;
|
private View contentWarningBar;
|
||||||
private TextView contentWarningDescription;
|
private TextView contentWarningDescription;
|
||||||
|
@ -76,16 +77,10 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
moreButton = (ImageButton) itemView.findViewById(R.id.status_more);
|
moreButton = (ImageButton) itemView.findViewById(R.id.status_more);
|
||||||
reblogged = false;
|
reblogged = false;
|
||||||
favourited = false;
|
favourited = false;
|
||||||
mediaPreview0 = (NetworkImageView) itemView.findViewById(R.id.status_media_preview_0);
|
mediaPreview0 = (ImageView) itemView.findViewById(R.id.status_media_preview_0);
|
||||||
mediaPreview1 = (NetworkImageView) itemView.findViewById(R.id.status_media_preview_1);
|
mediaPreview1 = (ImageView) itemView.findViewById(R.id.status_media_preview_1);
|
||||||
mediaPreview2 = (NetworkImageView) itemView.findViewById(R.id.status_media_preview_2);
|
mediaPreview2 = (ImageView) itemView.findViewById(R.id.status_media_preview_2);
|
||||||
mediaPreview3 = (NetworkImageView) itemView.findViewById(R.id.status_media_preview_3);
|
mediaPreview3 = (ImageView) itemView.findViewById(R.id.status_media_preview_3);
|
||||||
int mediaPreviewUnloadedId = ThemeUtils.getDrawableId(itemView.getContext(),
|
|
||||||
R.attr.media_preview_unloaded_drawable, android.R.color.black);
|
|
||||||
mediaPreview0.setDefaultImageResId(mediaPreviewUnloadedId);
|
|
||||||
mediaPreview1.setDefaultImageResId(mediaPreviewUnloadedId);
|
|
||||||
mediaPreview2.setDefaultImageResId(mediaPreviewUnloadedId);
|
|
||||||
mediaPreview3.setDefaultImageResId(mediaPreviewUnloadedId);
|
|
||||||
sensitiveMediaWarning = itemView.findViewById(R.id.status_sensitive_media_warning);
|
sensitiveMediaWarning = itemView.findViewById(R.id.status_sensitive_media_warning);
|
||||||
contentWarningBar = itemView.findViewById(R.id.status_content_warning_bar);
|
contentWarningBar = itemView.findViewById(R.id.status_content_warning_bar);
|
||||||
contentWarningDescription =
|
contentWarningDescription =
|
||||||
|
@ -225,23 +220,29 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
private void setMediaPreviews(final Status.MediaAttachment[] attachments,
|
private void setMediaPreviews(final Status.MediaAttachment[] attachments,
|
||||||
boolean sensitive, final StatusActionListener listener) {
|
boolean sensitive, final StatusActionListener listener) {
|
||||||
final NetworkImageView[] previews = {
|
final ImageView[] previews = {
|
||||||
mediaPreview0,
|
mediaPreview0,
|
||||||
mediaPreview1,
|
mediaPreview1,
|
||||||
mediaPreview2,
|
mediaPreview2,
|
||||||
mediaPreview3
|
mediaPreview3
|
||||||
};
|
};
|
||||||
Context context = mediaPreview0.getContext();
|
Context context = mediaPreview0.getContext();
|
||||||
ImageLoader imageLoader = VolleySingleton.getInstance(context).getImageLoader();
|
|
||||||
|
int mediaPreviewUnloadedId = ThemeUtils.getDrawableId(itemView.getContext(),
|
||||||
|
R.attr.media_preview_unloaded_drawable, android.R.color.black);
|
||||||
|
|
||||||
final int n = Math.min(attachments.length, Status.MAX_MEDIA_ATTACHMENTS);
|
final int n = Math.min(attachments.length, Status.MAX_MEDIA_ATTACHMENTS);
|
||||||
|
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
String previewUrl = attachments[i].getPreviewUrl();
|
String previewUrl = attachments[i].getPreviewUrl();
|
||||||
previews[i].setImageUrl(previewUrl, imageLoader);
|
|
||||||
if (!sensitive) {
|
previews[i].setVisibility(View.VISIBLE);
|
||||||
previews[i].setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
Picasso.with(context)
|
||||||
previews[i].setVisibility(View.GONE);
|
.load(previewUrl)
|
||||||
}
|
.placeholder(mediaPreviewUnloadedId)
|
||||||
|
.into(previews[i]);
|
||||||
|
|
||||||
final String url = attachments[i].getUrl();
|
final String url = attachments[i].getUrl();
|
||||||
final Status.MediaAttachment.Type type = attachments[i].getType();
|
final Status.MediaAttachment.Type type = attachments[i].getType();
|
||||||
previews[i].setOnClickListener(new View.OnClickListener() {
|
previews[i].setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -251,22 +252,20 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sensitive) {
|
if (sensitive) {
|
||||||
sensitiveMediaWarning.setVisibility(View.VISIBLE);
|
sensitiveMediaWarning.setVisibility(View.VISIBLE);
|
||||||
sensitiveMediaWarning.setOnClickListener(new View.OnClickListener() {
|
sensitiveMediaWarning.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
v.setVisibility(View.GONE);
|
v.setVisibility(View.GONE);
|
||||||
for (int i = 0; i < n; i++) {
|
|
||||||
previews[i].setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
v.setOnClickListener(null);
|
v.setOnClickListener(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide any of the placeholder previews beyond the ones set.
|
// Hide any of the placeholder previews beyond the ones set.
|
||||||
for (int i = n; i < Status.MAX_MEDIA_ATTACHMENTS; i++) {
|
for (int i = n; i < Status.MAX_MEDIA_ATTACHMENTS; i++) {
|
||||||
previews[i].setImageUrl(null, imageLoader);
|
|
||||||
previews[i].setVisibility(View.GONE);
|
previews[i].setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,6 @@ class TimelineAdapter extends RecyclerView.Adapter implements AdapterItemRemover
|
||||||
} else {
|
} else {
|
||||||
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
FooterViewHolder holder = (FooterViewHolder) viewHolder;
|
||||||
holder.setState(footerState);
|
holder.setState(footerState);
|
||||||
holder.setupButton(footerListener);
|
|
||||||
holder.setRetryMessage(R.string.footer_retry_statuses);
|
|
||||||
holder.setEndOfTimelineMessage(R.string.footer_end_of_statuses);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,9 @@ public class ViewThreadActivity extends BaseActivity {
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
ActionBar bar = getSupportActionBar();
|
ActionBar bar = getSupportActionBar();
|
||||||
if (bar != null) {
|
if (bar != null) {
|
||||||
bar.setTitle(R.string.title_thread);
|
bar.setTitle(null);
|
||||||
|
bar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
bar.setDisplayShowHomeEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String id = getIntent().getStringExtra("id");
|
String id = getIntent().getStringExtra("id");
|
||||||
|
@ -54,10 +56,8 @@ public class ViewThreadActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.action_back: {
|
case android.R.id.home: {
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
onBackPressed();
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
app/src/main/res/anim/slide_from_left.xml
Normal file
6
app/src/main/res/anim/slide_from_left.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate android:fromXDelta="-100%p" android:toXDelta="0"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
6
app/src/main/res/anim/slide_from_right.xml
Normal file
6
app/src/main/res/anim/slide_from_right.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate android:fromXDelta="100%p" android:toXDelta="0"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
6
app/src/main/res/anim/slide_to_left.xml
Normal file
6
app/src/main/res/anim/slide_to_left.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate android:fromXDelta="0" android:toXDelta="-100%p"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
6
app/src/main/res/anim/slide_to_right.xml
Normal file
6
app/src/main/res/anim/slide_to_right.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<translate android:fromXDelta="0" android:toXDelta="100%p"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
|
@ -4,8 +4,8 @@
|
||||||
<shape>
|
<shape>
|
||||||
<gradient
|
<gradient
|
||||||
android:angle="90"
|
android:angle="90"
|
||||||
android:startColor="#FF000000"
|
android:startColor="#FF1a1c23"
|
||||||
android:endColor="#00000000"
|
android:endColor="#001a1c23"
|
||||||
android:type="linear" />
|
android:type="linear" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
8
app/src/main/res/drawable/account_header_missing.xml
Normal file
8
app/src/main/res/drawable/account_header_missing.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@color/color_background_dark" />
|
||||||
|
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/elephant_friend.png
Normal file
BIN
app/src/main/res/drawable/elephant_friend.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
9
app/src/main/res/drawable/ic_attach_file_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_attach_file_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/toolbar_icon_dark"
|
||||||
|
android:pathData="M16.5,6v11.5c0,2.21 -1.79,4 -4,4s-4,-1.79 -4,-4V5c0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v10.5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V6H10v9.5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V5c0,-2.21 -1.79,-4 -4,-4S7,2.79 7,5v12.5c0,3.04 2.46,5.5 5.5,5.5s5.5,-2.46 5.5,-5.5V6h-1.5z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_send_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_send_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/toolbar_icon_dark"
|
||||||
|
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_visibility_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_visibility_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/toolbar_icon_dark"
|
||||||
|
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
|
||||||
|
</vector>
|
|
@ -3,12 +3,12 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
|
|
||||||
<solid android:color="@color/media_preview_unloaded_background_dark" />
|
<solid android:color="@color/color_background_dark" />
|
||||||
|
|
||||||
<stroke
|
<stroke
|
||||||
android:dashWidth="4dp"
|
android:dashWidth="4dp"
|
||||||
android:dashGap="4dp"
|
android:dashGap="4dp"
|
||||||
android:width="2dp"
|
android:width="2dp"
|
||||||
android:color="#AFAFAF" />
|
android:color="@color/color_primary_dark" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
|
@ -71,6 +71,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/account_display_name"
|
android:id="@+id/account_display_name"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
android:textStyle="normal|bold"
|
android:textStyle="normal|bold"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
@ -78,6 +80,8 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
android:textColor="?android:textColorSecondary"
|
android:textColor="?android:textColorSecondary"
|
||||||
android:id="@+id/account_username" />
|
android:id="@+id/account_username" />
|
||||||
|
|
||||||
|
|
|
@ -1,95 +1,92 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/activity_compose"
|
android:id="@+id/activity_compose"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:srcCompat="@drawable/ic_media"
|
|
||||||
style="?attr/image_button_style"
|
|
||||||
android:id="@+id/compose_photo_pick"
|
|
||||||
android:layout_marginLeft="8dp" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:id="@+id/compose_options"
|
|
||||||
app:srcCompat="@drawable/ic_options"
|
|
||||||
style="?attr/image_button_style"
|
|
||||||
android:layout_marginLeft="8dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/compose_content_warning_bar"
|
android:orientation="vertical">
|
||||||
android:layout_margin="8dp"
|
<android.support.v7.widget.Toolbar
|
||||||
android:paddingLeft="8dp"
|
android:id="@+id/toolbar"
|
||||||
android:paddingRight="8dp">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:inputType="text"
|
android:elevation="4dp"
|
||||||
android:ems="10"
|
android:layout_marginBottom="16dp"
|
||||||
android:id="@+id/field_content_warning"
|
android:background="?attr/toolbar_background_color" />
|
||||||
android:hint="@string/hint_content_warning" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/compose_edit_area">
|
|
||||||
|
|
||||||
<!--An special EditText is created at runtime here, because it has to be a modified
|
|
||||||
* anonymous class to support image/GIF picking from the soft keyboard.-->
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:id="@+id/compose_content_warning_bar"
|
||||||
android:id="@+id/compose_media_preview_bar"
|
android:paddingTop="0dp"
|
||||||
android:layout_alignParentBottom="true">
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
<!--This is filled at runtime with ImageView's for each preview in the upload queue.-->
|
android:layout_marginBottom="4dp">
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/field_content_warning"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/hint_content_warning"
|
||||||
|
android:inputType="text" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:id="@+id/compose_edit_area">
|
||||||
|
|
||||||
<LinearLayout
|
<!--An special EditText is created at runtime here, because it has to be a modified
|
||||||
android:layout_width="match_parent"
|
* anonymous class to support image/GIF picking from the soft keyboard.-->
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Space
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:orientation="horizontal"
|
||||||
|
android:id="@+id/compose_media_preview_bar"
|
||||||
|
android:layout_alignParentBottom="true">
|
||||||
|
|
||||||
<TextView
|
<!--This is filled at runtime with ImageView's for each preview in the upload queue.-->
|
||||||
android:id="@+id/characters_left"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="500" />
|
|
||||||
|
|
||||||
<Button
|
</LinearLayout>
|
||||||
android:text="@string/action_send"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/button_send" />
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/characters_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?android:textColorPrimary"
|
||||||
|
android:text="500" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/floating_btn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_send_24dp"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
|
@ -4,15 +4,9 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:padding="16dp"
|
||||||
tools:context="com.keylesspalace.tusky.LoginActivity">
|
tools:context="com.keylesspalace.tusky.LoginActivity">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:elevation="4dp"
|
|
||||||
android:background="?attr/toolbar_background_color" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
@ -21,30 +15,44 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true">
|
android:layout_centerInParent="true"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
<EditText
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="textUri"
|
android:src="@drawable/elephant_friend"/>
|
||||||
android:hint="@string/hint_domain"
|
|
||||||
android:ems="10"
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/edit_text_domain" />
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="wrap_content">
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textUri"
|
||||||
|
android:hint="@string/hint_domain"
|
||||||
|
android:ems="10"
|
||||||
|
android:id="@+id/edit_text_domain" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:text="@string/action_login"
|
android:id="@+id/button_login"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/button_login" />
|
android:layout_marginTop="4dp"
|
||||||
|
android:elevation="0dp"
|
||||||
|
android:text="@string/action_login" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/text_error" />
|
android:id="@+id/text_error" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textAlignment="center"
|
||||||
android:id="@+id/no_account"
|
android:id="@+id/no_account"
|
||||||
android:text="@string/link_no_account" />
|
android:text="@string/link_no_account" />
|
||||||
|
|
||||||
|
|
|
@ -3,19 +3,18 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
android:id="@+id/account_container">
|
android:id="@+id/account_container">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/account_avatar"
|
android:id="@+id/account_avatar"
|
||||||
android:layout_marginLeft="@dimen/account_avatar_margin"
|
android:layout_marginRight="10dp" />
|
||||||
android:layout_marginRight="@dimen/account_avatar_margin"
|
|
||||||
android:layout_marginTop="@dimen/account_avatar_margin" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -28,11 +27,13 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/account_display_name"
|
android:id="@+id/account_display_name"
|
||||||
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textStyle="normal|bold" />
|
android:textStyle="normal|bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?android:textColorSecondary"
|
||||||
android:id="@+id/account_username" />
|
android:id="@+id/account_username" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/account_note"
|
android:id="@+id/account_note"
|
||||||
android:layout_margin="@dimen/account_note_margin" />
|
android:paddingTop="4dp"
|
||||||
|
android:textColor="?android:textColorTertiary" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -7,89 +7,69 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/follow_icon"
|
android:id="@+id/follow_icon"
|
||||||
app:srcCompat="@drawable/ic_followed"
|
app:srcCompat="@drawable/ic_person_add_24dp"
|
||||||
android:paddingTop="@dimen/notification_icon_vertical_padding"
|
android:paddingRight="10dp"
|
||||||
android:paddingBottom="@dimen/notification_icon_vertical_padding"
|
android:paddingLeft="24dp"
|
||||||
android:paddingRight="@dimen/status_avatar_padding"
|
android:tint="?attr/colorAccent" />
|
||||||
android:paddingLeft="@dimen/follow_icon_left_padding"
|
|
||||||
android:tint="?attr/notification_icon_tint" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/notification_text"
|
android:id="@+id/notification_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?android:textColorTertiary"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
android:layout_toRightOf="@id/follow_icon" />
|
android:layout_toRightOf="@id/follow_icon" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
<ImageView
|
||||||
android:layout_width="64dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="64dp"
|
android:layout_height="40dp"
|
||||||
android:id="@+id/notification_avatar"
|
android:id="@+id/notification_avatar"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:paddingLeft="@dimen/status_avatar_padding"
|
android:layout_marginLeft="8dp"
|
||||||
android:paddingRight="@dimen/status_avatar_padding"
|
android:layout_marginRight="10dp"
|
||||||
android:paddingBottom="@dimen/status_avatar_padding"
|
|
||||||
android:layout_alignParentLeft="true" />
|
android:layout_alignParentLeft="true" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/notification_follow_button"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:text="@string/action_follow" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="64dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_toRightOf="@id/notification_avatar"
|
android:layout_toRightOf="@id/notification_avatar">
|
||||||
android:layout_toLeftOf="@id/notification_follow_button">
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/notification_display_name"
|
android:id="@+id/notification_display_name"
|
||||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:textStyle="normal|bold" />
|
android:textStyle="normal|bold" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/notification_username"
|
android:id="@+id/notification_username"
|
||||||
android:textColor="?android:textColorSecondary" />
|
android:textColor="?android:textColorSecondary" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -10,39 +11,10 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_gravity="center">
|
android:layout_gravity="center">
|
||||||
|
|
||||||
<com.keylesspalace.tusky.FlowLayout
|
|
||||||
android:id="@+id/footer_retry_bar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/footer_retry_message"
|
|
||||||
android:padding="@dimen/footer_text_padding" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/footer_retry_button"
|
|
||||||
android:text="@string/action_retry" />
|
|
||||||
|
|
||||||
</com.keylesspalace.tusky.FlowLayout>
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/footer_progress_bar"
|
android:id="@+id/footer_progress_bar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/footer_end_of_timeline_text"
|
|
||||||
android:padding="@dimen/footer_text_padding"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -117,6 +117,7 @@
|
||||||
android:textOff="@string/status_content_warning_show_more"
|
android:textOff="@string/status_content_warning_show_more"
|
||||||
android:padding="3dp"
|
android:padding="3dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
android:textAllCaps="true"
|
||||||
android:background="?attr/content_warning_button" />
|
android:background="?attr/content_warning_button" />
|
||||||
|
|
||||||
</com.keylesspalace.tusky.FlowLayout>
|
</com.keylesspalace.tusky.FlowLayout>
|
||||||
|
@ -126,26 +127,81 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
android:layout_toRightOf="@+id/status_avatar"
|
android:layout_toRightOf="@+id/status_avatar"
|
||||||
android:layout_toEndOf="@+id/status_avatar"
|
android:layout_toEndOf="@+id/status_avatar"
|
||||||
android:layout_below="@+id/status_content_warning_bar" />
|
android:layout_below="@+id/status_content_warning_bar" />
|
||||||
|
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
android:id="@+id/status_media_preview_container"
|
android:id="@+id/status_media_preview_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_below="@+id/status_content"
|
android:layout_below="@+id/status_content"
|
||||||
android:layout_toRightOf="@+id/status_avatar">
|
android:layout_toRightOf="@+id/status_avatar">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/status_media_preview_0"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/status_media_preview_height"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/status_media_preview_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/status_media_preview_height"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/status_media_preview_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/status_media_preview_height"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/status_media_preview_3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/status_media_preview_height"
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/status_sensitive_media_warning"
|
android:id="@+id/status_sensitive_media_warning"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/status_media_preview_top_margin"
|
android:layout_marginTop="@dimen/status_media_preview_top_margin"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:background="?attr/sensitive_media_warning_background_color"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:background="?attr/sensitive_media_warning_background_color"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -154,7 +210,7 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:text="@string/status_sensitive_media_title"
|
android:text="@string/status_sensitive_media_title"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textStyle="normal|italic" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -162,53 +218,8 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:text="@string/status_sensitive_media_directions"
|
android:text="@string/status_sensitive_media_directions"
|
||||||
android:textColor="@android:color/white" />
|
android:textColor="@android:color/white" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</FrameLayout>
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
|
||||||
android:id="@+id/status_media_preview_0"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/status_media_preview_height"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
|
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
|
||||||
android:id="@+id/status_media_preview_1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/status_media_preview_height"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
|
||||||
android:id="@+id/status_media_preview_2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/status_media_preview_height"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<com.android.volley.toolbox.NetworkImageView
|
|
||||||
android:id="@+id/status_media_preview_3"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/status_media_preview_height"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
@ -217,7 +228,7 @@
|
||||||
android:layout_below="@id/status_media_preview_container"
|
android:layout_below="@id/status_media_preview_container"
|
||||||
android:layout_toRightOf="@+id/status_avatar"
|
android:layout_toRightOf="@+id/status_avatar"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingTop="10dp">
|
android:paddingTop="6dp">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
app:srcCompat="@drawable/ic_reply_24dp"
|
app:srcCompat="@drawable/ic_reply_24dp"
|
||||||
|
|
|
@ -1,39 +1,47 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:id="@+id/notification_top_bar">
|
android:id="@+id/notification_top_bar">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/notification_icon"
|
android:id="@+id/notification_icon"
|
||||||
android:paddingTop="@dimen/notification_icon_vertical_padding"
|
android:paddingRight="10dp"
|
||||||
android:paddingBottom="@dimen/notification_icon_vertical_padding"
|
android:paddingLeft="24dp"
|
||||||
android:paddingLeft="@dimen/notification_icon_left_padding"
|
app:srcCompat="@drawable/ic_repeat_24dp"
|
||||||
android:paddingRight="@dimen/status_avatar_padding"
|
android:tint="?attr/colorAccent" />
|
||||||
android:tint="?attr/notification_icon_tint" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/notification_text"
|
android:id="@+id/notification_text"
|
||||||
|
android:textColor="?android:textColorSecondary"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:text="Someone favourited your status"
|
||||||
android:layout_toRightOf="@id/notification_icon" />
|
android:layout_toRightOf="@id/notification_icon" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/notification_content"
|
android:id="@+id/notification_content"
|
||||||
android:paddingLeft="@dimen/notification_avatar_column_width"
|
android:paddingLeft="58dp"
|
||||||
android:textColor="?attr/notification_content"
|
android:text="Example status here"
|
||||||
android:paddingBottom="8dp" />
|
android:textColor="?android:textColorTertiary"
|
||||||
|
android:paddingBottom="10dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
12
app/src/main/res/menu/compose_toolbar.xml
Normal file
12
app/src/main/res/menu/compose_toolbar.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item android:id="@+id/compose_photo_pick"
|
||||||
|
android:title="@string/action_photo_pick"
|
||||||
|
android:icon="@drawable/ic_attach_file_24dp"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
<item android:id="@+id/compose_options"
|
||||||
|
android:title="@string/action_compose_options"
|
||||||
|
android:icon="@drawable/ic_visibility_24dp"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
</menu>
|
|
@ -3,9 +3,4 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item android:id="@+id/action_back"
|
|
||||||
android:title="@string/action_back"
|
|
||||||
android:icon="@drawable/ic_back"
|
|
||||||
app:showAsAction="always" />
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
3
app/src/main/res/transition/activity_slide.xml
Normal file
3
app/src/main/res/transition/activity_slide.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<slide xmlns:android="http://schemas.android.com/apk/res/"
|
||||||
|
android:duration="1000"/>
|
|
@ -75,7 +75,7 @@
|
||||||
<string name="status_username_format">\@%s</string>
|
<string name="status_username_format">\@%s</string>
|
||||||
<string name="status_boosted_format">%s boosted</string>
|
<string name="status_boosted_format">%s boosted</string>
|
||||||
<string name="status_sensitive_media_title">Sensitive Media</string>
|
<string name="status_sensitive_media_title">Sensitive Media</string>
|
||||||
<string name="status_sensitive_media_directions">Click to view.</string>
|
<string name="status_sensitive_media_directions">Click to view</string>
|
||||||
<string name="status_content_warning_show_more">Show More</string>
|
<string name="status_content_warning_show_more">Show More</string>
|
||||||
<string name="status_content_warning_show_less">Show Less</string>
|
<string name="status_content_warning_show_less">Show Less</string>
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<string name="report_comment_hint">Additional Comments?</string>
|
<string name="report_comment_hint">Additional Comments?</string>
|
||||||
|
|
||||||
<string name="action_compose">Compose</string>
|
<string name="action_compose">Compose</string>
|
||||||
<string name="action_login">Ask Site To Log In</string>
|
<string name="action_login">Login with Mastodon</string>
|
||||||
<string name="action_logout">Log Out</string>
|
<string name="action_logout">Log Out</string>
|
||||||
<string name="action_follow">Follow</string>
|
<string name="action_follow">Follow</string>
|
||||||
<string name="action_unfollow">Unfollow</string>
|
<string name="action_unfollow">Unfollow</string>
|
||||||
|
@ -120,9 +120,9 @@
|
||||||
<string name="confirmation_send">Toot!</string>
|
<string name="confirmation_send">Toot!</string>
|
||||||
<string name="confirmation_reported">Sent!</string>
|
<string name="confirmation_reported">Sent!</string>
|
||||||
|
|
||||||
<string name="hint_domain">Which Site?</string>
|
<string name="hint_domain">Which instance?</string>
|
||||||
<string name="hint_compose">What\'s Happening?</string>
|
<string name="hint_compose">What\'s happening?</string>
|
||||||
<string name="hint_content_warning">Beware, folks</string>
|
<string name="hint_content_warning">Content warning</string>
|
||||||
|
|
||||||
<string name="link_no_account">No account?</string>
|
<string name="link_no_account">No account?</string>
|
||||||
|
|
||||||
|
@ -152,5 +152,9 @@
|
||||||
<string name="pref_title_notification_style_light">Notify with light</string>
|
<string name="pref_title_notification_style_light">Notify with light</string>
|
||||||
<string name="pref_title_appearance_settings">Appearance</string>
|
<string name="pref_title_appearance_settings">Appearance</string>
|
||||||
<string name="pref_title_light_theme">Use The Light Theme</string>
|
<string name="pref_title_light_theme">Use The Light Theme</string>
|
||||||
|
<string name="action_submit">Submit</string>
|
||||||
|
<string name="action_photo_pick">Add media</string>
|
||||||
|
<string name="action_compose_options">Privacy options</string>
|
||||||
|
<string name="login_success">Welcome back!</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<item name="status_favourite_button_tint">@color/status_favourite_button_dark</item>
|
<item name="status_favourite_button_tint">@color/status_favourite_button_dark</item>
|
||||||
<item name="status_favourite_button_marked_tint">@color/status_favourite_button_marked_dark</item>
|
<item name="status_favourite_button_marked_tint">@color/status_favourite_button_marked_dark</item>
|
||||||
<item name="content_warning_button">@drawable/toggle_small</item>
|
<item name="content_warning_button">@drawable/toggle_small</item>
|
||||||
<item name="sensitive_media_warning_background_color">@color/sensitive_media_warning_background_dark</item>
|
<item name="sensitive_media_warning_background_color">@color/color_background_dark</item>
|
||||||
<item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_dark</item>
|
<item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_dark</item>
|
||||||
<item name="status_divider_drawable">@drawable/status_divider_dark</item>
|
<item name="status_divider_drawable">@drawable/status_divider_dark</item>
|
||||||
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_dark</item>
|
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_dark</item>
|
||||||
|
|
Loading…
Reference in a new issue