Merge branch 'torrentcome-#142/SaveToots'

This commit is contained in:
Vavassor 2017-07-07 19:07:17 -04:00
commit b322bcfe54
15 changed files with 614 additions and 20 deletions

View File

@ -55,4 +55,9 @@ dependencies {
}
compile 'org.bouncycastle:bcprov-jdk15on:1.57'
testCompile 'junit:junit:4.12'
//room
compile "android.arch.persistence.room:runtime:1.0.0-alpha3"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha3"
}

View File

@ -26,6 +26,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SavedTootActivity"
android:configChanges="orientation|screenSize|keyboardHidden">
</activity>
<activity
android:name=".LoginActivity"
android:windowSoftInputMode="adjustResize">

View File

@ -75,7 +75,12 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.keylesspalace.tusky.db.TootDao;
import com.keylesspalace.tusky.db.TootEntity;
import com.keylesspalace.tusky.entity.Account;
import com.keylesspalace.tusky.entity.Media;
import com.keylesspalace.tusky.entity.Status;
@ -122,6 +127,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
private static final int PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 1;
private static final int COMPOSE_SUCCESS = -1;
private static final int THUMBNAIL_SIZE = 128; // pixels
private static TootDao tootDao = TuskyApplication.getDB().tootDao();
private EditTextTyped textEditor;
private LinearLayout mediaPreviewBar;
@ -147,6 +153,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
private InputContentInfoCompat currentInputContentInfo;
private int currentFlags;
private Uri photoUploadUri;
private int savedTootUid = 0;
/**
* The Target object must be stored as a member field or method and cannot be an anonymous class otherwise this won't work as expected. The reason is that Picasso accepts this parameter as a weak memory reference. Because anonymous classes are eligible for garbage collection when there are no more references, the network request to fetch the image may finish after this anonymous class has already been reclaimed. See this Stack Overflow discussion for more details.
@ -191,6 +198,16 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
onSendClicked();
}
});
floatingBtn.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
boolean b = saveTheToot(textEditor.getText().toString());
if (b) {
Toast.makeText(ComposeActivity.this, R.string.action_save_one_toot, Toast.LENGTH_SHORT).show();
}
return b;
}
});
pickBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -278,6 +295,26 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
startingContentWarning = intent.getStringExtra("content_warning");
}
}
/* If come from SavedTootActivity
* */
String savedTootText = intent.getStringExtra("saved_toot_text");
if (!TextUtils.isEmpty(savedTootText)) {
textEditor.append(savedTootText);
}
String savedJsonUrls = intent.getStringExtra("saved_json_urls");
if (!TextUtils.isEmpty(savedJsonUrls)) {
// try to redo a list of media
ArrayList<String> playersList = new Gson().fromJson(savedJsonUrls,
new TypeToken<ArrayList<String>>() {
}.getType());
}
int savedTootUid = intent.getIntExtra("saved_toot_uid", 0);
if (savedTootUid != 0) {
this.savedTootUid = savedTootUid;
}
}
/* If the currently logged in account is locked, its posts should default to private. This
@ -442,7 +479,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
}
private void doErrorDialog(@StringRes int descriptionId, @StringRes int actionId,
View.OnClickListener listener) {
View.OnClickListener listener) {
Snackbar bar = Snackbar.make(findViewById(R.id.activity_compose), getString(descriptionId),
Snackbar.LENGTH_SHORT);
bar.setAction(actionId, listener);
@ -493,6 +530,38 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
}
}
public boolean saveTheToot(String s) {
if (TextUtils.isEmpty(s)) {
return false;
} else {
final TootEntity toot = new TootEntity();
toot.setText(s);
if (mediaQueued != null && mediaQueued.size() > 0) {
List<String> list = new ArrayList<>();
for (QueuedMedia q :
mediaQueued) {
list.add(q.uri.toString());
}
String json = new Gson().toJson(list);
toot.setUrls(json);
}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
if (savedTootUid != 0) {
toot.setUid(savedTootUid);
tootDao.updateToot(toot);
} else {
tootDao.insert(toot);
}
return null;
}
}.execute();
return true;
}
}
private void setStatusVisibility(String visibility) {
statusVisibility = visibility;
switch (visibility) {
@ -1355,7 +1424,9 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
private class MentionAutoCompleteAdapter extends ArrayAdapter<Account> implements Filterable {
private ArrayList<Account> resultList;
private @LayoutRes int layoutId;
private
@LayoutRes
int layoutId;
MentionAutoCompleteAdapter(Context context, @LayoutRes int resource) {
super(context, resource);

View File

@ -65,7 +65,6 @@ import retrofit2.Response;
public class MainActivity extends BaseActivity {
private static final String TAG = "MainActivity"; // logging tag
protected static int COMPOSE_RESULT = 1;
private static final long DRAWER_ITEM_EDIT_PROFILE = 0;
private static final long DRAWER_ITEM_FAVOURITES = 1;
private static final long DRAWER_ITEM_MUTED_USERS = 2;
@ -75,7 +74,10 @@ public class MainActivity extends BaseActivity {
private static final long DRAWER_ITEM_ABOUT = 6;
private static final long DRAWER_ITEM_LOG_OUT = 7;
private static final long DRAWER_ITEM_FOLLOW_REQUESTS = 8;
private static final long DRAWER_ITEM_SAVED_TOOT = 9;
protected static int COMPOSE_RESULT = 1;
public FloatingActionButton composeButton;
private String loggedInAccountId;
private String loggedInAccountUsername;
private Stack<Integer> pageHistory;
@ -83,8 +85,6 @@ public class MainActivity extends BaseActivity {
private Drawer drawer;
private ViewPager viewPager;
public FloatingActionButton composeButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -179,7 +179,8 @@ public class MainActivity extends BaseActivity {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {}
public void onTabReselected(TabLayout.Tab tab) {
}
});
Intent intent = getIntent();
@ -289,23 +290,28 @@ public class MainActivity extends BaseActivity {
R.drawable.ic_mute_24dp, getTheme());
ThemeUtils.setDrawableTint(this, muteDrawable, R.attr.toolbar_icon_tint);
List<IDrawerItem> listItem = new ArrayList<>();
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_EDIT_PROFILE).withName(getString(R.string.action_edit_profile)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_person));
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_FAVOURITES).withName(getString(R.string.action_view_favourites)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_star));
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_MUTED_USERS).withName(getString(R.string.action_view_mutes)).withSelectable(false).withIcon(muteDrawable));
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_BLOCKED_USERS).withName(getString(R.string.action_view_blocks)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_block));
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_SEARCH).withName(getString(R.string.action_search)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_search));
listItem.add(new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_SAVED_TOOT).withName(getString(R.string.action_access_saved_toot)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_save));
listItem.add(new DividerDrawerItem());
listItem.add(new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_PREFERENCES).withName(getString(R.string.action_view_preferences)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_settings));
listItem.add(new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_ABOUT).withName(getString(R.string.about_title_activity)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_info));
listItem.add(new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_LOG_OUT).withName(getString(R.string.action_logout)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_exit_to_app));
IDrawerItem[] array = new IDrawerItem[listItem.size()];
listItem.toArray(array); // fill the array
drawer = new DrawerBuilder()
.withActivity(this)
//.withToolbar(toolbar)
.withAccountHeader(headerResult)
.withHasStableIds(true)
.withSelectedItem(-1)
.addDrawerItems(
new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_EDIT_PROFILE).withName(getString(R.string.action_edit_profile)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_person),
new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_FAVOURITES).withName(getString(R.string.action_view_favourites)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_star),
new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_MUTED_USERS).withName(getString(R.string.action_view_mutes)).withSelectable(false).withIcon(muteDrawable),
new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_BLOCKED_USERS).withName(getString(R.string.action_view_blocks)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_block),
new PrimaryDrawerItem().withIdentifier(DRAWER_ITEM_SEARCH).withName(getString(R.string.action_search)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_search),
new DividerDrawerItem(),
new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_PREFERENCES).withName(getString(R.string.action_view_preferences)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_settings),
new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_ABOUT).withName(getString(R.string.about_title_activity)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_info),
new SecondaryDrawerItem().withIdentifier(DRAWER_ITEM_LOG_OUT).withName(getString(R.string.action_logout)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_exit_to_app)
)
.addDrawerItems(array)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
@ -341,6 +347,9 @@ public class MainActivity extends BaseActivity {
Intent intent = new Intent(MainActivity.this, AccountListActivity.class);
intent.putExtra("type", AccountListActivity.Type.FOLLOW_REQUESTS);
startActivity(intent);
} else if (drawerItemIdentifier == DRAWER_ITEM_SAVED_TOOT) {
Intent intent = new Intent(MainActivity.this, SavedTootActivity.class);
startActivity(intent);
}
}
@ -469,9 +478,9 @@ public class MainActivity extends BaseActivity {
@Override
public void onBackPressed() {
if(drawer != null && drawer.isDrawerOpen()) {
if (drawer != null && drawer.isDrawerOpen()) {
drawer.closeDrawer();
} else if(pageHistory.size() < 2) {
} else if (pageHistory.size() < 2) {
super.onBackPressed();
} else {
pageHistory.pop();

View File

@ -0,0 +1,143 @@
/* Copyright 2017 Andrew Dawson
*
* This file is a part of Tusky.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Tusky; if not,
* see <http://www.gnu.org/licenses>. */
package com.keylesspalace.tusky;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.keylesspalace.tusky.adapter.SavedTootAdapter;
import com.keylesspalace.tusky.db.TootDao;
import com.keylesspalace.tusky.db.TootEntity;
import com.keylesspalace.tusky.util.ThemeUtils;
import java.util.List;
public class SavedTootActivity extends BaseActivity implements SavedTootAdapter.SavedTootAction {
// dao
private static TootDao tootDao = TuskyApplication.getDB().tootDao();
// ui
private SavedTootAdapter adapter;
private TextView noContent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_saved_toot);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar bar = getSupportActionBar();
if (bar != null) {
bar.setTitle(getString(R.string.title_saved_toot));
bar.setDisplayHomeAsUpEnabled(true);
bar.setDisplayShowHomeEnabled(true);
}
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
noContent = (TextView) findViewById(R.id.no_content);
recyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
DividerItemDecoration divider = new DividerItemDecoration(
this, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(this, R.attr.status_divider_drawable,
R.drawable.status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
adapter = new SavedTootAdapter(this);
recyclerView.setAdapter(adapter);
}
@Override
protected void onResume() {
super.onResume();
// req
getAllToot();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: {
onBackPressed();
return true;
}
}
return super.onOptionsItemSelected(item);
}
public void getAllToot() {
new AsyncTask<Void, Void, List<TootEntity>>() {
@Override
protected List<TootEntity> doInBackground(Void... params) {
return tootDao.loadAll();
}
@Override
protected void onPostExecute(List<TootEntity> tootEntities) {
super.onPostExecute(tootEntities);
// set ui
setNoContent(tootEntities.size());
if (adapter != null) {
adapter.setItems(tootEntities);
adapter.notifyDataSetChanged();
}
}
}.execute();
}
private void setNoContent(int size) {
if (size == 0) {
noContent.setVisibility(View.VISIBLE);
} else {
noContent.setVisibility(View.INVISIBLE);
}
}
@Override
public void delete(int position, TootEntity item) {
// update DB
tootDao.delete(item);
// update adapter
if (adapter != null) {
adapter.removeItem(position);
setNoContent(adapter.getItemCount());
}
}
@Override
public void click(int position, TootEntity item) {
Intent intent = new Intent(this, ComposeActivity.class);
intent.putExtra("saved_toot_uid", item.getUid());
intent.putExtra("saved_toot_text", item.getText());
intent.putExtra("saved_json_urls", item.getUrls());
startActivity(intent);
}
}

View File

@ -16,12 +16,14 @@
package com.keylesspalace.tusky;
import android.app.Application;
import android.arch.persistence.room.Room;
import android.net.Uri;
import android.util.Log;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.keylesspalace.tusky.db.AppDatabase;
import com.keylesspalace.tusky.util.OkHttpUtils;
import com.squareup.picasso.Picasso;
import com.jakewharton.picasso.OkHttp3Downloader;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
@ -30,6 +32,11 @@ import java.security.Security;
public class TuskyApplication extends Application {
private static final String TAG = "TuskyApplication"; // logging tag
private static AppDatabase db;
public static AppDatabase getDB() {
return db;
}
@Override
public void onCreate() {
@ -84,5 +91,8 @@ public class TuskyApplication extends Application {
}
}
}
db = Room.databaseBuilder(getApplicationContext(),
AppDatabase.class, "tuskyDB").allowMainThreadQueries().build();
}
}

View File

@ -0,0 +1,139 @@
/* Copyright 2017 Andrew Dawson
*
* This file is a part of Tusky.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Tusky; if not,
* see <http://www.gnu.org/licenses>. */
package com.keylesspalace.tusky.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import com.keylesspalace.tusky.R;
import com.keylesspalace.tusky.db.TootEntity;
import java.util.ArrayList;
import java.util.List;
public class SavedTootAdapter extends RecyclerView.Adapter {
private List<TootEntity> list;
private SavedTootAction handler;
public SavedTootAdapter(Context context) {
super();
list = new ArrayList<>();
handler = (SavedTootAction) context;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_saved_toot, parent, false);
return new TootViewHolder(view);
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
TootViewHolder holder = (TootViewHolder) viewHolder;
holder.bind(position, getItem(position));
}
@Override
public int getItemCount() {
return list.size();
}
public void setItems(List<TootEntity> newToot) {
list = new ArrayList<>();
list.addAll(newToot);
}
public void addItems(List<TootEntity> newToot) {
int end = list.size();
list.addAll(newToot);
notifyItemRangeInserted(end, newToot.size());
}
@Nullable
public TootEntity removeItem(int position) {
if (position < 0 || position >= list.size()) {
return null;
}
TootEntity toot = list.remove(position);
notifyItemRemoved(position);
return toot;
}
public TootEntity getItem(int position) {
if (position >= 0 && position < list.size()) {
return list.get(position);
}
return null;
}
// handler saved toot
public interface SavedTootAction {
void delete(int position, TootEntity item);
void click(int position, TootEntity item);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
TextView mTextView;
public ViewHolder(TextView v) {
super(v);
mTextView = v;
}
}
private class TootViewHolder extends RecyclerView.ViewHolder {
View view;
TextView content;
ImageButton suppr;
TootViewHolder(View view) {
super(view);
this.view = view;
this.content = (TextView) view.findViewById(R.id.content);
this.suppr = (ImageButton) view.findViewById(R.id.suppr);
}
void bind(final int position, final TootEntity item) {
if (item != null) {
if (!TextUtils.isEmpty(item.getText()))
content.setText(item.getText());
else
content.setText("");
suppr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handler.delete(position, item);
}
});
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handler.click(position, item);
}
});
}
}
}
}

View File

@ -0,0 +1,14 @@
package com.keylesspalace.tusky.db;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.RoomDatabase;
/**
* DB version & declare DAO
*/
@Database(entities = {TootEntity.class}, version = 1, exportSchema = false)
public abstract class AppDatabase extends RoomDatabase {
public abstract TootDao tootDao();
}

View File

@ -0,0 +1,47 @@
package com.keylesspalace.tusky.db;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.PrimaryKey;
/**
* Media model
*/
@Entity(foreignKeys = @ForeignKey(entity = TootEntity.class,
parentColumns = "uid",
childColumns = "toot_id"))
public class MediaEntity {
@ColumnInfo(name = "toot_id")
private int toot_id;
@PrimaryKey(autoGenerate = true)
private int uid;
@ColumnInfo(name = "url")
private String url;
// getter setter
public int getToot_id() {
return toot_id;
}
public void setToot_id(int toot_id) {
this.toot_id = toot_id;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@ -0,0 +1,34 @@
package com.keylesspalace.tusky.db;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;
import java.util.List;
/**
* Created by cto3543 on 28/06/2017.
* crud interface on this Toot DB
*/
@Dao
public interface TootDao {
// c
@Insert
long insert(TootEntity users);
// r
@Query("SELECT * FROM TootEntity")
List<TootEntity> loadAll();
// u
@Update
void updateToot(TootEntity toot);
// d
@Delete
int delete(TootEntity user);
}

View File

@ -0,0 +1,46 @@
package com.keylesspalace.tusky.db;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
/**
* toot model
*/
@Entity
public class TootEntity {
@PrimaryKey(autoGenerate = true)
private int uid;
@ColumnInfo(name = "text")
private String text;
@ColumnInfo(name = "urls")
private String urls;
// getter setter
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getUrls() {
return urls;
}
public void setUrls(String urls) {
this.urls = urls;
}
}

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_view_thread"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.keylesspalace.tusky.AccountListActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/toolbar_background_color"
android:elevation="4dp" />
<TextView
android:id="@+id/no_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/no_content"
android:visibility="invisible" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.91"
android:padding="8dp" />
<ImageButton
android:id="@+id/suppr"
style="?attr/image_button_style"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:padding="16dp"
android:layout_margin="16dp"
android:contentDescription="@string/action_unmute"
app:srcCompat="@drawable/ic_clear_24dp" />
</LinearLayout>

View File

@ -32,6 +32,7 @@
<string name="title_blocks">Blocked users</string>
<string name="title_follow_requests">Follow Requests</string>
<string name="title_edit_profile">Edit your profile</string>
<string name="title_saved_toot">Saved Toot</string>
<string name="status_username_format">\@%s</string>
<string name="status_boosted_format">%s boosted</string>
@ -98,6 +99,7 @@
<string name="action_accept">Accept</string>
<string name="action_reject">Reject</string>
<string name="action_search">Search</string>
<string name="action_access_saved_toot">Drafts</string>
<string name="send_status_link_to">Share toot URL to…</string>
<string name="send_status_content_to">Share toot to…</string>
@ -191,4 +193,9 @@
<string name="status_media_video">Video</string>
<string name="state_follow_requested">Follow requested</string>
<string name="combine_s1_s2">%1$s %2$s</string>
<string name="no_content">no content</string>
<string name="action_save_one_toot">Toot saved !</string>
</resources>

View File

@ -16,6 +16,7 @@ allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
}