Merge branch 'develop'

This commit is contained in:
stom79 2018-05-12 12:12:14 +02:00
commit bc54432781
90 changed files with 2078 additions and 313 deletions

View File

@ -7,8 +7,8 @@ android {
applicationId "fr.gouv.etalab.mastodon"
minSdkVersion 15
targetSdkVersion 27
versionCode 122
versionName "1.8.9"
versionCode 123
versionName "1.9.0"
}
flavorDimensions "default"
buildTypes {
@ -40,7 +40,7 @@ allprojects {
}
ext.supportLibraryVersion = '27.1.1'
ext.glideLibraryVersion = '4.6.1'
ext.conscryptLibraryVersion = '1.0.1'
ext.conscryptLibraryVersion = '1.1.2'
ext.evernoteLibraryVersion = '1.2.5'
ext.gsonLibraryVersion = '2.8.2'
ext.guavaLibraryVersion = '24.1-android'

View File

@ -69,11 +69,20 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_about);
@ -153,6 +162,16 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
}
});
Button about_support = findViewById(R.id.about_support);
about_support.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79/donate"));
startActivity(browserIntent);
}
});
setTitle(R.string.action_about);
lv_contributors.setExpanded(true);
lv_developers.setExpanded(true);

View File

@ -25,6 +25,7 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.AsyncTask;
@ -117,6 +118,7 @@ import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_TARGETED_ACCOUNT;
import static fr.gouv.etalab.mastodon.helper.Helper.NOTIFICATION_INTENT;
import static fr.gouv.etalab.mastodon.helper.Helper.PREF_KEY_ID;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
import static fr.gouv.etalab.mastodon.helper.Helper.changeUser;
import static fr.gouv.etalab.mastodon.helper.Helper.menuAccounts;
@ -165,10 +167,18 @@ public abstract class BaseMainActivity extends BaseActivity
final int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_main);
@ -192,6 +202,8 @@ public abstract class BaseMainActivity extends BaseActivity
//Here, the user is authenticated
appBar = findViewById(R.id.appBar);
Toolbar toolbar = findViewById(R.id.toolbar);
if( theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.black));
setSupportActionBar(toolbar);
toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
toolbar_search = toolbar.findViewById(R.id.toolbar_search);
@ -210,7 +222,10 @@ public abstract class BaseMainActivity extends BaseActivity
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
iconHome.setImageResource(R.drawable.ic_home);
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
if( theme == THEME_BLACK)
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
else
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
@ -387,7 +402,11 @@ public abstract class BaseMainActivity extends BaseActivity
if( tab.getCustomView() != null) {
ImageView icon = tab.getCustomView().findViewById(R.id.tab_icon);
if( icon != null)
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
if( theme == THEME_BLACK)
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
else
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
}
}
@ -569,8 +588,10 @@ public abstract class BaseMainActivity extends BaseActivity
});
//Hide the default title
if( getSupportActionBar() != null)
if( getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().getThemedContext().setTheme(R.style.AppThemeBlack);
}
//Defines the current locale of the device in a static variable
currentLocale = Helper.currentLocale(getApplicationContext());

View File

@ -112,11 +112,20 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_edit_profile);
ActionBar actionBar = getSupportActionBar();

View File

@ -19,6 +19,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
@ -40,6 +41,7 @@ import fr.gouv.etalab.mastodon.drawers.StatusListAdapter;
import fr.gouv.etalab.mastodon.helper.Helper;
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveFeedsInterface;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
/**
@ -68,14 +70,24 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_hashtag);
Toolbar toolbar = findViewById(R.id.toolbar);
if( theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(HashTagActivity.this, R.color.black));
setSupportActionBar(toolbar);
if( getSupportActionBar() != null)
@ -118,9 +130,6 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
new RetrieveFeedsAsyncTask(getApplicationContext(), RetrieveFeedsAsyncTask.Type.TAG, tag,null, max_id, HashTagActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
final LinearLayoutManager mLayoutManager;
mLayoutManager = new LinearLayoutManager(this);
lv_status.setLayoutManager(mLayoutManager);

View File

@ -57,11 +57,20 @@ public class InstanceActivity extends BaseActivity implements OnRetrieveInstance
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_instance);

View File

@ -18,6 +18,7 @@ package fr.gouv.etalab.mastodon.activities;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@ -76,7 +77,21 @@ public class InstanceHealthActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(R.style.AppThemeDark_NoActionBar);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_instance_social);
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Bundle b = getIntent().getExtras();

View File

@ -21,6 +21,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
@ -50,6 +51,8 @@ import fr.gouv.etalab.mastodon.drawers.StatusListAdapter;
import fr.gouv.etalab.mastodon.helper.Helper;
import fr.gouv.etalab.mastodon.interfaces.OnListActionInterface;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
/**
* Created by Thomas on 14/12/2017.
@ -76,15 +79,24 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_list);
Toolbar toolbar = findViewById(R.id.toolbar);
if( theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(ListActivity.this, R.color.black));
setSupportActionBar(toolbar);
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
statuses = new ArrayList<>();
@ -158,9 +170,27 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
new ManageListsAsyncTask(ListActivity.this,listId, null ,null, ListActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ListActivity.this, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ListActivity.this, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ListActivity.this, R.color.black_3));
break;
}
new ManageListsAsyncTask(ListActivity.this,listId, null ,null, ListActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

View File

@ -111,11 +111,20 @@ public class LoginActivity extends BaseActivity {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if (theme == Helper.THEME_LIGHT) {
setTheme(R.style.AppTheme);
} else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_login);
if (theme == Helper.THEME_DARK) {

View File

@ -18,6 +18,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
@ -66,7 +67,25 @@ public class ManageAccountsInListActivity extends BaseActivity implements OnList
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(R.style.AppThemeDark_NoActionBar);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ManageAccountsInListActivity.this, R.color.mastodonC3__));
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ManageAccountsInListActivity.this, R.color.mastodonC1));
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ManageAccountsInListActivity.this, R.color.black_3));
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ManageAccountsInListActivity.this, R.color.mastodonC1));
}
setContentView(R.layout.activity_manage_accounts_list);
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
if( getSupportActionBar() != null)

View File

@ -64,6 +64,7 @@ import fr.gouv.etalab.mastodon.interfaces.OnDownloadInterface;
import static fr.gouv.etalab.mastodon.helper.Helper.EXTERNAL_STORAGE_REQUEST_CODE;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
@ -93,6 +94,8 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
private ProgressBar pbar_inf;
private TextView message_ready;
private boolean canSwipe;
private TextView media_description;
private Attachment attachment;
private enum actionSwipe{
RIGHT_TO_LEFT,
@ -105,12 +108,11 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == THEME_BLACK)
setTheme(R.style.TransparentBlack);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_media);
SwipeBackLayout mSwipeBackLayout = new SwipeBackLayout(MediaActivity.this);
mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_BOTTOM);
@ -140,9 +142,12 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
RelativeLayout main_container_media = findViewById(R.id.main_container_media);
if( theme == Helper.THEME_LIGHT){
main_container_media.setBackgroundResource(R.color.mastodonC2);
}else {
}else if( theme == Helper.THEME_BLACK){
main_container_media.setBackgroundResource(R.color.black);
}else if( theme == Helper.THEME_DARK){
main_container_media.setBackgroundResource(R.color.mastodonC1_);
}
media_description = findViewById(R.id.media_description);
message_ready = findViewById(R.id.message_ready);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
@ -178,6 +183,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
// DO DELAYED STUFF
media_close.setVisibility(View.GONE);
media_save.setVisibility(View.GONE);
media_description.setVisibility(View.GONE);
scheduleHidden = false;
}
}, 2000);
@ -187,8 +193,13 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
videoView = findViewById(R.id.media_video);
prev = findViewById(R.id.media_prev);
next = findViewById(R.id.media_next);
changeDrawableColor(getApplicationContext(), prev,R.color.mastodonC4);
changeDrawableColor(getApplicationContext(), next,R.color.mastodonC4);
if( theme == THEME_BLACK){
changeDrawableColor(getApplicationContext(), prev, R.color.dark_icon);
changeDrawableColor(getApplicationContext(), next, R.color.dark_icon);
}else {
changeDrawableColor(getApplicationContext(), prev, R.color.mastodonC4);
changeDrawableColor(getApplicationContext(), next, R.color.mastodonC4);
}
prev.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -234,12 +245,20 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
scheduleHidden = true;
media_close.setVisibility(View.VISIBLE);
media_save.setVisibility(View.VISIBLE);
if( attachment != null && attachment.getDescription() != null && !attachment.getDescription().equals("null")){
media_description.setText(attachment.getDescription());
media_description.setVisibility(View.VISIBLE);
}else{
media_description.setText("");
media_description.setVisibility(View.GONE);
}
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
media_close.setVisibility(View.GONE);
media_save.setVisibility(View.GONE);
media_description.setVisibility(View.GONE);
scheduleHidden = false;
}
}, 2000);
@ -293,7 +312,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
if( mediaPosition < 1)
mediaPosition = attachments.size();
currentAction = action;
final Attachment attachment = attachments.get(mediaPosition-1);
attachment = attachments.get(mediaPosition-1);
String type = attachment.getType();
String url = attachment.getUrl();
finalUrlDownload = url;
@ -302,6 +321,14 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
videoView.stopPlayback();
}
imageView.setVisibility(View.GONE);
if( attachment.getDescription() != null && !attachment.getDescription().equals("null")){
media_description.setText(attachment.getDescription());
media_description.setVisibility(View.VISIBLE);
}else{
media_description.setText("");
media_description.setVisibility(View.GONE);
}
preview_url = attachment.getPreview_url();
if( type.equals("unknown")){
preview_url = attachment.getRemote_url();

View File

@ -29,6 +29,7 @@ import android.graphics.drawable.BitmapDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
@ -73,6 +74,8 @@ import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
import fr.gouv.etalab.mastodon.sqlite.StatusCacheDAO;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
/**
* Created by Thomas on 17/02/2018.
@ -104,10 +107,18 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_ower_status);
@ -118,6 +129,8 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
new IntentFilter(Helper.INTENT_BACKUP_FINISH));
Toolbar toolbar = findViewById(R.id.toolbar);
if( theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(OwnerStatusActivity.this, R.color.black));
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
@ -192,9 +205,26 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
swipeRefreshLayout = findViewById(R.id.swipeContainer);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(OwnerStatusActivity.this, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(OwnerStatusActivity.this, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(OwnerStatusActivity.this, R.color.black_3));
break;
}
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {

View File

@ -36,11 +36,20 @@ public class PrivacyActivity extends BaseActivity {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_privacy);

View File

@ -17,9 +17,9 @@ package fr.gouv.etalab.mastodon.activities;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
@ -30,15 +30,9 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import java.lang.reflect.Proxy;
import fr.gouv.etalab.mastodon.R;
import fr.gouv.etalab.mastodon.helper.Helper;
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_THEME_INTENT;
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
/**
* Created by Thomas on 19/01/2018.
@ -53,15 +47,30 @@ public class ProxyActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(R.style.AppThemeDark_NoActionBar);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ProxyActivity.this, R.color.mastodonC3__));
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ProxyActivity.this, R.color.mastodonC1));
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ProxyActivity.this, R.color.black_3));
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
getWindow().getDecorView().setBackgroundColor(ContextCompat.getColor(ProxyActivity.this, R.color.mastodonC1));
}
setContentView(R.layout.activity_proxy);
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Bundle b = getIntent().getExtras();
if( getSupportActionBar() != null)
getSupportActionBar().hide();
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
//Enable proxy
boolean enable_proxy = sharedpreferences.getBoolean(Helper.SET_PROXY_ENABLED, false);
final CheckBox set_enable_proxy = findViewById(R.id.enable_proxy);
@ -100,9 +109,6 @@ public class ProxyActivity extends BaseActivity {
proxy_type.setAdapter(adapterTrans);
proxy_type.setSelection(sharedpreferences.getInt(Helper.SET_PROXY_TYPE, 0));
proxy_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
@ -120,9 +126,6 @@ public class ProxyActivity extends BaseActivity {
}
});
save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

View File

@ -100,11 +100,20 @@ public class RemoteFollowActivity extends BaseActivity implements OnRetrieveRemo
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_remote_follow);
rf_instance = findViewById(R.id.rf_instance);

View File

@ -57,11 +57,20 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_search_result);
loader = findViewById(R.id.loader);

View File

@ -140,10 +140,18 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_show_account);
setTitle("");

View File

@ -24,6 +24,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.DividerItemDecoration;
@ -65,6 +66,8 @@ import fr.gouv.etalab.mastodon.interfaces.OnRetrieveFeedsInterface;
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
/**
* Created by Thomas on 04/05/2017.
@ -90,16 +93,26 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme_NoActionBar);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark_NoActionBar);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack_NoActionBar);
break;
default:
setTheme(R.style.AppThemeDark_NoActionBar);
}
expanded = false;
setContentView(R.layout.activity_show_conversation);
Toolbar toolbar = findViewById(R.id.toolbar);
if( theme == THEME_BLACK)
toolbar.setBackgroundColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.black));
setSupportActionBar(toolbar);
Bundle b = getIntent().getExtras();
@ -202,9 +215,26 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
swipeRefreshLayout = findViewById(R.id.swipeContainer);
new RetrieveFeedsAsyncTask(getApplicationContext(), RetrieveFeedsAsyncTask.Type.ONESTATUS, statusId,null, false,false, ShowConversationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.black_3));
break;
}
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {

View File

@ -200,11 +200,20 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(getApplicationContext()));
final int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_toot);
ActionBar actionBar = getSupportActionBar();

View File

@ -58,11 +58,20 @@ public class WebviewActivity extends BaseActivity {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_webview);
Bundle b = getIntent().getExtras();
if(b != null)

View File

@ -59,11 +59,20 @@ public class WebviewConnectActivity extends BaseActivity {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
switch (theme){
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_DARK:
setTheme(R.style.AppThemeDark);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_webview_connect);
Bundle b = getIntent().getExtras();
if(b != null)

View File

@ -1628,6 +1628,9 @@ public class API {
attachment.setType(attObj.get("type").toString());
attachment.setText_url(attObj.get("text_url").toString());
attachment.setUrl(attObj.get("url").toString());
try {
attachment.setDescription(attObj.get("description").toString());
}catch (JSONException ignore){}
attachments.add(attachment);
}
}

View File

@ -451,13 +451,21 @@ public class Status implements Parcelable{
if( (status.getReblog() != null && status.getReblog().getContent() == null) || (status.getReblog() == null && status.getContent() == null))
return;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
int mode;
if( isCompactMode)
mode = Html.FROM_HTML_MODE_COMPACT;
else
mode = Html.FROM_HTML_MODE_LEGACY;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableStringContent = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY));
spannableStringContent = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent(), mode));
else
//noinspection deprecation
spannableStringContent = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent()));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableStringCW = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getSpoiler_text():status.getSpoiler_text(), Html.FROM_HTML_MODE_LEGACY));
spannableStringCW = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getSpoiler_text():status.getSpoiler_text(), mode));
else
//noinspection deprecation
spannableStringCW = new SpannableString(Html.fromHtml(status.getReblog() != null ?status.getReblog().getSpoiler_text():status.getSpoiler_text()));
@ -474,9 +482,16 @@ public class Status implements Parcelable{
return;
if( (status.getReblog() != null && status.getReblog().getContent() == null) || (status.getReblog() == null && status.getContent() == null))
return;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
int mode;
if( isCompactMode)
mode = Html.FROM_HTML_MODE_COMPACT;
else
mode = Html.FROM_HTML_MODE_LEGACY;
SpannableString spannableStringTranslated;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated(), Html.FROM_HTML_MODE_LEGACY));
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated(), mode));
else
//noinspection deprecation
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated()));
@ -558,10 +573,16 @@ public class Status implements Parcelable{
if( ((Activity)context).isFinishing() )
return;
SpannableString spannableStringTranslated = null;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
int mode;
if( isCompactMode)
mode = Html.FROM_HTML_MODE_COMPACT;
else
mode = Html.FROM_HTML_MODE_LEGACY;
if( status.getContentTranslated() != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated(), Html.FROM_HTML_MODE_LEGACY));
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated(), mode));
else
//noinspection deprecation
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated()));
@ -661,7 +682,7 @@ public class Status implements Parcelable{
matchStart, matchEnd,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
if( matchStart >= 0 && matchEnd <= spannableString.toString().length() && matchEnd >= matchStart)
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, theme==Helper.THEME_DARK?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
//Deals with mention to make them clickable
@ -693,7 +714,7 @@ public class Status implements Parcelable{
startPosition, endPosition,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
if( startPosition >= 0 && endPosition <= spannableString.toString().length() && endPosition >= startPosition)
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, theme==Helper.THEME_DARK?R.color.mastodonC2:R.color.mastodonC4)), startPosition, endPosition,
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), startPosition, endPosition,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
}
@ -722,7 +743,7 @@ public class Status implements Parcelable{
}
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
if( matchStart >= 0 && matchEnd <= spannableString.toString().length() && matchEnd >= matchStart)
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, theme==Helper.THEME_DARK?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
return spannableString;

View File

@ -100,9 +100,12 @@ public class ListAdapter extends BaseAdapter implements OnListActionInterface {
if( theme == Helper.THEME_LIGHT){
holder.search_container.setBackgroundResource(R.color.mastodonC3__);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.black);
}else {
}else if(theme == Helper.THEME_DARK){
holder.search_container.setBackgroundResource(R.color.mastodonC1_);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}else if(theme == Helper.THEME_BLACK) {
holder.search_container.setBackgroundResource(R.color.black_2);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}
Drawable next = ContextCompat.getDrawable(context, R.drawable.ic_keyboard_arrow_right);
holder.search_title.setText(list.getTitle());

View File

@ -70,6 +70,7 @@ import fr.gouv.etalab.mastodon.client.Entities.Attachment;
import fr.gouv.etalab.mastodon.client.Entities.Emojis;
import fr.gouv.etalab.mastodon.client.Entities.Error;
import fr.gouv.etalab.mastodon.helper.CrossActions;
import fr.gouv.etalab.mastodon.helper.CustomTextView;
import fr.gouv.etalab.mastodon.interfaces.OnPostActionInterface;
import fr.gouv.etalab.mastodon.interfaces.OnPostNotificationsActionInterface;
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveEmojiInterface;
@ -77,6 +78,7 @@ import fr.gouv.etalab.mastodon.client.Entities.Notification;
import fr.gouv.etalab.mastodon.client.Entities.Status;
import fr.gouv.etalab.mastodon.helper.Helper;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_DARK;
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
import static fr.gouv.etalab.mastodon.helper.Helper.getLiveInstance;
@ -131,7 +133,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
if (theme == THEME_DARK){
if (theme == THEME_DARK || theme == THEME_BLACK){
holder.main_container_trans.setAlpha(.3f);
}else {
holder.main_container_trans.setAlpha(.1f);
@ -146,6 +148,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
typeString = String.format("@%s %s", notification.getAccount().getUsername(),context.getString(R.string.notif_mention));
if( theme == Helper.THEME_DARK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_1));
}else if( theme == Helper.THEME_BLACK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_black_1));
}else {
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_light_1));
}
@ -161,6 +165,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
typeString = String.format("@%s %s", notification.getAccount().getUsername(),context.getString(R.string.notif_reblog));
if( theme == Helper.THEME_DARK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_2));
}else if( theme == Helper.THEME_BLACK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_black_2));
}else {
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_light_2));
}
@ -176,6 +182,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
typeString = String.format("@%s %s", notification.getAccount().getUsername(),context.getString(R.string.notif_favourite));
if( theme == Helper.THEME_DARK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_3));
}else if( theme == Helper.THEME_BLACK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_black_3));
}else {
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_light_3));
}
@ -191,6 +199,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
typeString = String.format("@%s %s", notification.getAccount().getUsername(),context.getString(R.string.notif_follow));
if( theme == Helper.THEME_DARK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_4));
}else if( theme == Helper.THEME_BLACK){
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_black_4));
}else {
holder.card_status_container.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_light_4));
}
@ -198,10 +208,20 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
holder.main_container_trans.setVisibility(View.GONE);
break;
}
changeDrawableColor(context, R.drawable.ic_chat_bubble_outline, R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_repeat_head,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_star_border_header,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_follow_notif_header,R.color.mastodonC4);
if( theme == THEME_BLACK){
changeDrawableColor(context, R.drawable.ic_chat_bubble_outline, R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_repeat_head,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_star_border_header,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_follow_notif_header,R.color.dark_icon);
}else {
changeDrawableColor(context, R.drawable.ic_chat_bubble_outline, R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_repeat_head,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_star_border_header,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_follow_notif_header,R.color.mastodonC4);
}
holder.notification_type.setText(typeString);
if( imgH != null) {
holder.notification_type.setCompoundDrawablePadding((int)Helper.convertDpToPixel(5, context));
@ -221,7 +241,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
//Manages theme for icon colors
if( theme == Helper.THEME_DARK){
if( theme == Helper.THEME_DARK || theme == THEME_BLACK){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
@ -300,7 +320,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_star,R.color.marked_icon);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_star);
}else {
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
@ -311,13 +331,13 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_repeat_boost,R.color.boost_icon);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_repeat_boost);
}else {
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_repeat);
}
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
@ -371,7 +391,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
holder.status_reblog_count.setCompoundDrawables(imgReblog, null, null, null);
holder.status_reply.setCompoundDrawables(imgReply, null, null, null);
if( theme == THEME_DARK){
if( theme == THEME_DARK || theme == THEME_BLACK){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
@ -1029,10 +1049,10 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
class ViewHolder extends RecyclerView.ViewHolder {
FrameLayout card_status_container;
TextView notification_status_content;
CustomTextView notification_status_content;
TextView notification_type;
LinearLayout status_spoiler_container;
TextView status_spoiler;
CustomTextView status_spoiler;
Button status_spoiler_button;
TextView notification_account_username;
ImageView notification_account_profile;

View File

@ -97,9 +97,12 @@ public class SearchTootsListAdapter extends BaseAdapter {
if( theme == Helper.THEME_LIGHT){
holder.search_container.setBackgroundResource(R.color.mastodonC3__);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.black);
}else {
}else if(theme == Helper.THEME_DARK){
holder.search_container.setBackgroundResource(R.color.mastodonC1_);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}else if(theme == Helper.THEME_BLACK) {
holder.search_container.setBackgroundResource(R.color.black_2);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}
Drawable next = ContextCompat.getDrawable(context, R.drawable.ic_keyboard_arrow_right);
holder.search_title.setText(search);

View File

@ -105,6 +105,7 @@ import fr.gouv.etalab.mastodon.client.Entities.Error;
import fr.gouv.etalab.mastodon.client.Entities.Status;
import fr.gouv.etalab.mastodon.fragments.DisplayStatusFragment;
import fr.gouv.etalab.mastodon.helper.CrossActions;
import fr.gouv.etalab.mastodon.helper.CustomTextView;
import fr.gouv.etalab.mastodon.helper.Helper;
import fr.gouv.etalab.mastodon.interfaces.OnPostActionInterface;
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveCardInterface;
@ -117,6 +118,7 @@ import fr.gouv.etalab.mastodon.sqlite.StatusCacheDAO;
import fr.gouv.etalab.mastodon.sqlite.TempMuteDAO;
import static fr.gouv.etalab.mastodon.activities.MainActivity.currentLocale;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_DARK;
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
import static fr.gouv.etalab.mastodon.helper.Helper.getLiveInstance;
@ -139,6 +141,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
private String targetedId;
private final int DISPLAYED_STATUS = 1;
private final int FOCUSED_STATUS = 2;
private final int COMPACT_STATUS = 3;
private int conversationPosition;
private List<String> timedMute;
@ -223,7 +226,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
super.onViewAttachedToWindow(holder);
if( holder.getItemViewType() == DISPLAYED_STATUS) {
if( holder.getItemViewType() == DISPLAYED_STATUS || holder.getItemViewType() == COMPACT_STATUS) {
final ViewHolder viewHolder = (ViewHolder) holder;
// Bug workaround for losing text selection ability, see:
// https://code.google.com/p/android/issues/detail?id=208169
@ -238,9 +241,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
class ViewHolder extends RecyclerView.ViewHolder{
LinearLayout status_content_container;
LinearLayout status_spoiler_container;
TextView status_spoiler;
CustomTextView status_spoiler;
Button status_spoiler_button;
TextView status_content;
CustomTextView status_content;
TextView status_content_translated;
LinearLayout status_content_translated_container;
TextView status_account_username;
@ -373,10 +376,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Status status = statuses.get(position);
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
int HIDDEN_STATUS = 0;
String filter;
if( type == RetrieveFeedsAsyncTask.Type.CACHE_BOOKMARKS)
return DISPLAYED_STATUS;
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
else if( type == RetrieveFeedsAsyncTask.Type.CONTEXT && position == conversationPosition)
return FOCUSED_STATUS;
else if( type == RetrieveFeedsAsyncTask.Type.HOME)
@ -409,9 +413,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if (timedMute.contains(status.getAccount().getId()))
return HIDDEN_STATUS;
else
return DISPLAYED_STATUS;
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
}else {
return DISPLAYED_STATUS;
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
}
}
}else {
@ -421,9 +425,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else if( status.getIn_reply_to_id() != null && !status.getIn_reply_to_id().equals("null") && !((ShowAccountActivity)context).showReplies())
return HIDDEN_STATUS;
else
return DISPLAYED_STATUS;
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
}else
return DISPLAYED_STATUS;
return isCompactMode?COMPACT_STATUS:DISPLAYED_STATUS;
}
}
@ -432,6 +436,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if( viewType == DISPLAYED_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status, parent, false));
else if(viewType == COMPACT_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status_compact, parent, false));
else if(viewType == FOCUSED_STATUS)
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_status_focused, parent, false));
else
@ -443,7 +449,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
@Override
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int position) {
if( viewHolder.getItemViewType() == DISPLAYED_STATUS || viewHolder.getItemViewType() == FOCUSED_STATUS){
if( viewHolder.getItemViewType() == DISPLAYED_STATUS || viewHolder.getItemViewType() == FOCUSED_STATUS || viewHolder.getItemViewType() == COMPACT_STATUS){
final ViewHolder holder = (ViewHolder) viewHolder;
final Status status = statuses.get(position);
@ -462,7 +468,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
boolean displayBookmarkButton = sharedpreferences.getBoolean(Helper.SET_SHOW_BOOKMARK, true);
boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
if( displayBookmarkButton)
if( getItemViewType(position) != COMPACT_STATUS && displayBookmarkButton)
holder.status_bookmark.setVisibility(View.VISIBLE);
else
holder.status_bookmark.setVisibility(View.GONE);
@ -521,7 +527,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_bookmark.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
else
holder.status_bookmark.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark_border));
changeDrawableColor(context, R.drawable.ic_fiber_new,R.color.mastodonC4);
if( status.isNew())
holder.new_element.setVisibility(View.VISIBLE);
else
@ -562,8 +568,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
//Manages theme for icon colors
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_fiber_new,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_fiber_new,R.color.mastodonC4);
if( getItemViewType(position) == COMPACT_STATUS )
holder.status_privacy.setVisibility(View.GONE);
else
holder.status_privacy.setVisibility(View.VISIBLE);
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
if( theme == Helper.THEME_DARK){
if( theme == Helper.THEME_DARK || theme == Helper.THEME_BLACK){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
@ -577,8 +593,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
if( type != RetrieveFeedsAsyncTask.Type.CONTEXT)
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
}else {
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
@ -620,44 +635,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_spoiler.setText(status.getContentSpanCW(), TextView.BufferType.SPANNABLE);
holder.status_content.setMovementMethod(LinkMovementMethod.getInstance());
holder.status_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
//Manages translations
final MyTransL myTransL = MyTransL.getInstance(MyTransL.translatorEngine.YANDEX);
myTransL.setObfuscation(true);
myTransL.setYandexAPIKey(Helper.YANDEX_KEY);
holder.status_translate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if( !status.isTranslated() ){
String statusToTranslate;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
statusToTranslate = Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
statusToTranslate = Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent()).toString();
//TODO: removes the replaceAll once fixed with the lib
myTransL.translate(statusToTranslate, myTransL.getLocale(), new Results() {
@Override
public void onSuccess(Translate translate) {
if( translate.getTranslatedContent() != null) {
status.setTranslated(true);
status.setTranslationShown(true);
status.setContentTranslated(translate.getTranslatedContent());
status.makeClickableTranslation(context);
status.makeEmojisTranslation(context, StatusListAdapter.this);
notifyStatusChanged(status);
}else {
Toast.makeText(context, R.string.toast_error_translate, Toast.LENGTH_LONG).show();
}
}
@Override
public void onFail(HttpsConnectionException e) {
Toast.makeText(context, R.string.toast_error_translate, Toast.LENGTH_LONG).show();
}
});
}else {
status.setTranslationShown(!status.isTranslationShown());
notifyStatusChanged(status);
}
translateToot(status);
}
});
@ -716,7 +698,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
//Change the color in gray for accounts in DARK Theme only
Spannable wordtoSpan = new SpannableString(name);
if( theme == THEME_DARK) {
if( theme == THEME_DARK || theme == Helper.THEME_BLACK) {
Pattern hashAcct;
if( status.getReblog() != null)
hashAcct = Pattern.compile("\\s(@"+status.getReblog().getAccount().getAcct()+")");
@ -758,7 +740,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_mention_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
boolean displayBoost = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOOST_COUNT, true);
if( displayBoost) {
if( getItemViewType(position) != COMPACT_STATUS && displayBoost) {
if( status.getReblog() == null)
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
else
@ -790,7 +772,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_account_profile.setVisibility(View.VISIBLE);
}
holder.status_action_container.setVisibility(View.VISIBLE);
if( trans_forced || (translator != Helper.TRANS_NONE && currentLocale != null && status.getLanguage() != null && !status.getLanguage().trim().equals(currentLocale))){
if( ( getItemViewType(position) != COMPACT_STATUS ) && (trans_forced || (translator != Helper.TRANS_NONE && currentLocale != null && status.getLanguage() != null && !status.getLanguage().trim().equals(currentLocale)))){
holder.status_translate.setVisibility(View.VISIBLE);
}else {
holder.status_translate.setVisibility(View.GONE);
@ -899,7 +881,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
status.setSensitive(true);
if( theme == Helper.THEME_DARK)
if( theme == Helper.THEME_DARK || theme == Helper.THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
else
changeDrawableColor(context, R.drawable.ic_photo,R.color.mastodonC4);
@ -916,7 +898,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
status.setSensitive(true);
if( theme == Helper.THEME_DARK)
if( theme == Helper.THEME_DARK || theme == Helper.THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
else
changeDrawableColor(context, R.drawable.ic_photo,R.color.mastodonC4);
@ -968,7 +950,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
changeDrawableColor(context, R.drawable.ic_star,R.color.marked_icon);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_star);
}else {
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
@ -979,7 +961,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
changeDrawableColor(context, R.drawable.ic_repeat_boost,R.color.boost_icon);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_repeat_boost);
}else {
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
@ -987,7 +969,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
@ -1015,7 +997,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
changeDrawableColor(context, R.drawable.ic_pin_drop_p,R.color.marked_icon);
imgPin = ContextCompat.getDrawable(context, R.drawable.ic_pin_drop_p);
}else {
if( theme == THEME_DARK)
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.dark_icon);
else
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.black);
@ -1042,7 +1024,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
});
//Click on a conversation
if( getItemViewType(position) == DISPLAYED_STATUS) {
if( getItemViewType(position) == DISPLAYED_STATUS || getItemViewType(position) == COMPACT_STATUS) {
holder.status_content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1076,16 +1058,20 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
if( theme == Helper.THEME_LIGHT){
holder.main_container.setBackgroundResource(R.color.mastodonC3__);
}else {
}else if (theme == Helper.THEME_DARK){
holder.main_container.setBackgroundResource(R.color.mastodonC1_);
}else if (theme == Helper.THEME_BLACK){
holder.main_container.setBackgroundResource(R.color.black);
}
if( type == RetrieveFeedsAsyncTask.Type.CONTEXT ){
if( position == conversationPosition){
if( theme == Helper.THEME_LIGHT)
holder.main_container.setBackgroundResource(R.color.mastodonC3_);
else
else if( theme == Helper.THEME_DARK)
holder.main_container.setBackgroundResource(R.color.mastodonC1___);
else if( theme == Helper.THEME_BLACK)
holder.main_container.setBackgroundResource(R.color.black_2);
if( status.getCard() != null){
holder.status_cardview_content.setText(status.getCard().getDescription());
@ -1137,8 +1123,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_cardview_video.setVisibility(View.GONE);
if( theme == Helper.THEME_LIGHT)
holder.main_container.setBackgroundResource(R.color.mastodonC3__);
else
else if( theme == Helper.THEME_DARK)
holder.main_container.setBackgroundResource(R.color.mastodonC1_);
else if (theme == Helper.THEME_BLACK)
holder.main_container.setBackgroundResource(R.color.black);
}
}
@ -1407,6 +1395,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
builderInner.setTitle(stringArrayConf[1]);
doAction = API.StatusAction.BLOCK;
break;
case R.id.action_translate:
translateToot(status);
return true;
case R.id.action_report:
builderInner = new AlertDialog.Builder(context);
builderInner.setTitle(stringArrayConf[2]);
@ -1447,19 +1438,25 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
url = status.getUrl();
}
String extra_text = (status.getReblog() != null)?status.getReblog().getAccount().getAcct():status.getAccount().getAcct();
if( extra_text.split("@").length == 1)
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
else
extra_text = "@" + extra_text;
extra_text += " " + Helper.shortnameToUnicode(":link:",true) + " " + url + "\r\n-\n";
final String contentToot;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent()).toString();
extra_text += contentToot;
String extra_text;
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
if( share_details) {
extra_text = (status.getReblog() != null) ? status.getReblog().getAccount().getAcct() : status.getAccount().getAcct();
if (extra_text.split("@").length == 1)
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
else
extra_text = "@" + extra_text;
extra_text += " " + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
final String contentToot;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent()).toString();
extra_text += contentToot;
}else {
extra_text = url;
}
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
sendIntent.setType("text/plain");
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
@ -1573,6 +1570,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if( status.getApplication() != null && getItemViewType(position) == FOCUSED_STATUS){
Application application = status.getApplication();
holder.status_toot_app.setText(application.getName());
holder.status_toot_app.setVisibility(View.VISIBLE);
if( application.getWebsite() != null && !application.getWebsite().trim().equals("null"))
holder.status_toot_app.setOnClickListener(new View.OnClickListener() {
@Override
@ -1580,6 +1578,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Helper.openBrowser(context, application.getWebsite());
}
});
}else {
holder.status_toot_app.setVisibility(View.GONE);
}
}
}
@ -1957,4 +1957,42 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
}
private void translateToot(Status status){
//Manages translations
final MyTransL myTransL = MyTransL.getInstance(MyTransL.translatorEngine.YANDEX);
myTransL.setObfuscation(true);
myTransL.setYandexAPIKey(Helper.YANDEX_KEY);
if( !status.isTranslated() ){
String statusToTranslate;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
statusToTranslate = Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
statusToTranslate = Html.fromHtml(status.getReblog() != null ?status.getReblog().getContent():status.getContent()).toString();
//TODO: removes the replaceAll once fixed with the lib
myTransL.translate(statusToTranslate, myTransL.getLocale(), new Results() {
@Override
public void onSuccess(Translate translate) {
if( translate.getTranslatedContent() != null) {
status.setTranslated(true);
status.setTranslationShown(true);
status.setContentTranslated(translate.getTranslatedContent());
status.makeClickableTranslation(context);
status.makeEmojisTranslation(context, StatusListAdapter.this);
notifyStatusChanged(status);
}else {
Toast.makeText(context, R.string.toast_error_translate, Toast.LENGTH_LONG).show();
}
}
@Override
public void onFail(HttpsConnectionException e) {
Toast.makeText(context, R.string.toast_error_translate, Toast.LENGTH_LONG).show();
}
});
}else {
status.setTranslationShown(!status.isTranslationShown());
notifyStatusChanged(status);
}
}
}

View File

@ -66,7 +66,7 @@ public class TagsSearchAdapter extends ArrayAdapter<String> implements Filterabl
@NonNull
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
public View getView(final int position, View convertView, @NonNull ViewGroup parent) {
final String tag = tags.get(position);
final ViewHolder holder;

View File

@ -19,6 +19,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
@ -32,6 +33,7 @@ import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import fr.gouv.etalab.mastodon.activities.ListActivity;
import fr.gouv.etalab.mastodon.asynctasks.RetrieveManyRelationshipsAsyncTask;
import fr.gouv.etalab.mastodon.client.APIResponse;
import fr.gouv.etalab.mastodon.client.Entities.Account;
@ -132,9 +134,28 @@ public class DisplayAccountsFragment extends Fragment implements OnRetrieveAccou
asyncTask = new RetrieveAccountsAsyncTask(context, type, targetedId, max_id, DisplayAccountsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.black_3));
break;
}
if (type != RetrieveAccountsAsyncTask.Type.FOLLOWERS && type != RetrieveAccountsAsyncTask.Type.FOLLOWING)
asyncTask = new RetrieveAccountsAsyncTask(context, type, max_id, DisplayAccountsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

View File

@ -20,6 +20,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
@ -122,10 +123,27 @@ public class DisplayFollowRequestSentFragment extends Fragment implements OnRetr
asyncTask = new RetrieveFollowRequestSentAsyncTask(context, max_id, DisplayFollowRequestSentFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.black_3));
break;
}
asyncTask = new RetrieveFollowRequestSentAsyncTask(context, max_id, DisplayFollowRequestSentFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
return rootView;

View File

@ -21,6 +21,7 @@ import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
@ -133,9 +134,28 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
asyncTask = new RetrieveNotificationsAsyncTask(context, true, null, null, DisplayNotificationsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.black_3));
break;
}
if( context != null)
asyncTask = new RetrieveNotificationsAsyncTask(context, true, null, max_id, DisplayNotificationsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
else

View File

@ -117,7 +117,9 @@ public class DisplaySearchFragment extends Fragment {
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.black);
}else {
}else if(theme == Helper.THEME_DARK){
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}else if(theme == Helper.THEME_BLACK) {
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}
searchTootsListAdapter.notifyDataSetChanged();

View File

@ -23,6 +23,7 @@ import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@ -180,9 +181,28 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
}
}
});
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme){
case Helper.THEME_LIGHT:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.white));
break;
case Helper.THEME_DARK:
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4__,
R.color.mastodonC4,
R.color.mastodonC4);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.mastodonC1_));
break;
case Helper.THEME_BLACK:
swipeRefreshLayout.setColorSchemeResources(R.color.dark_icon,
R.color.mastodonC2,
R.color.mastodonC3);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ContextCompat.getColor(context, R.color.black_3));
break;
}
if( context != null) {
if (type == RetrieveFeedsAsyncTask.Type.USER)
asyncTask = new RetrieveFeedsAsyncTask(context, type, targetedId, max_id, showMediaOnly, showPinned, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

View File

@ -70,7 +70,7 @@ public class SettingsFragment extends Fragment {
private Context context;
private static final int ACTIVITY_CHOOSE_FILE = 411;
private TextView set_folder;
int count1, count2 = 0;
int count1, count2, count3 = 0;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -225,6 +225,32 @@ public class SettingsFragment extends Fragment {
}
});
boolean compact_mode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
final CheckBox set_compact_mode = rootView.findViewById(R.id.set_compact_mode);
set_compact_mode.setChecked(compact_mode);
set_compact_mode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_COMPACT_MODE, set_compact_mode.isChecked());
editor.apply();
}
});
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
final CheckBox set_share_details = rootView.findViewById(R.id.set_share_details);
set_share_details.setChecked(share_details);
set_share_details.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_SHARE_DETAILS, set_share_details.isChecked());
editor.apply();
}
});
boolean multiaccount_actions = sharedpreferences.getBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, true);
final CheckBox set_multiaccount_actions = rootView.findViewById(R.id.set_multiaccount_actions);
@ -428,25 +454,56 @@ public class SettingsFragment extends Fragment {
file_chooser.setVisibility(View.GONE);
}
final SwitchCompat set_night_mode = rootView.findViewById(R.id.set_night_mode);
set_night_mode.setChecked(theme == Helper.THEME_DARK);
set_night_mode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
final Spinner set_night_mode = rootView.findViewById(R.id.set_night_mode);
ArrayAdapter<CharSequence> adapterTheme = ArrayAdapter.createFromResource(getContext(),
R.array.settings_theme, android.R.layout.simple_spinner_item);
set_night_mode.setAdapter(adapterTheme);
int positionSpinnerTheme;
switch (sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK)){
case Helper.THEME_DARK:
positionSpinnerTheme = 0;
break;
case Helper.THEME_LIGHT:
positionSpinnerTheme = 1;
break;
case Helper.THEME_BLACK:
positionSpinnerTheme = 2;
break;
default:
positionSpinnerTheme = 0;
}
set_night_mode.setSelection(positionSpinnerTheme);
set_night_mode.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_THEME, isChecked?Helper.THEME_DARK:Helper.THEME_LIGHT);
editor.apply();
if( isChecked){
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if( count3 > 0){
SharedPreferences.Editor editor = sharedpreferences.edit();
switch (position){
case 0:
editor.putInt(Helper.SET_THEME, Helper.THEME_DARK);
editor.apply();
break;
case 1:
editor.putInt(Helper.SET_THEME, Helper.THEME_LIGHT);
editor.apply();
break;
case 2:
editor.putInt(Helper.SET_THEME, Helper.THEME_BLACK);
editor.apply();
break;
}
if( getActivity() != null)
getActivity().setTheme(R.style.AppThemeDark);
getActivity().recreate();
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(INTENT_ACTION, CHANGE_THEME_INTENT);
startActivity(intent);
}else {
if( getActivity() != null)
getActivity().setTheme(R.style.AppTheme);
count3++;
}
getActivity().recreate();
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(INTENT_ACTION, CHANGE_THEME_INTENT);
startActivity(intent);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
@ -633,7 +690,7 @@ public class SettingsFragment extends Fragment {
ArrayAdapter<CharSequence> adapterResize = ArrayAdapter.createFromResource(getContext(),
R.array.settings_resize_picture, android.R.layout.simple_spinner_item);
resize_layout_spinner.setAdapter(adapterResize);
int positionSpinnerResize = sharedpreferences.getInt(Helper.SET_PICTURE_RESIZE, Helper.S_1MO);
int positionSpinnerResize = sharedpreferences.getInt(Helper.SET_PICTURE_RESIZE, Helper.S_2MO);
resize_layout_spinner.setSelection(positionSpinnerResize);
resize_layout_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override

View File

@ -0,0 +1,60 @@
package fr.gouv.etalab.mastodon.helper;
/* Copyright 2018 Thomas Schneider
*
* This file is a part of Mastalab
*
* 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.
*
* Mastalab 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 Mastalab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.text.Selection;
import android.text.Spannable;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by Thomas on 12/05/2018.
* Allows to fix crashes with selection see: https://stackoverflow.com/a/36740247
*/
public class CustomTextView extends android.support.v7.widget.AppCompatTextView {
public CustomTextView(Context context) {
super(context);
}
public CustomTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean dispatchTouchEvent(final MotionEvent event) {
// FIXME simple workaround to https://code.google.com/p/android/issues/detail?id=191430
int startSelection = getSelectionStart();
int endSelection = getSelectionEnd();
if (startSelection < 0 || endSelection < 0){
Selection.setSelection((Spannable) getText(), getText().length());
} else if (startSelection != endSelection) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
final CharSequence text = getText();
setText(null);
setText(text);
}
}
return super.dispatchTouchEvent(event);
}
}

View File

@ -242,14 +242,18 @@ public class Helper {
public static final String SET_PICTURE_RESIZE = "set_picture_resize";
public static final String SET_SHOW_BOOKMARK = "set_show_bookmark";
public static final String SET_FULL_PREVIEW = "set_full_preview";
public static final String SET_COMPACT_MODE = "set_compact_mode";
public static final String SET_SHARE_DETAILS = "set_share_details";
public static final int S_512KO = 1;
public static final int S_1MO = 2;
public static final int S_2MO = 3;
public static final int ATTACHMENT_ALWAYS = 1;
public static final int ATTACHMENT_WIFI = 2;
public static final int ATTACHMENT_ASK = 3;
public static final int THEME_LIGHT = 1;
public static final int THEME_DARK = 2;
public static final int THEME_BLACK = 3;
public static final int LED_COLOUR = 0;
@ -970,7 +974,7 @@ public class Helper {
final SharedPreferences sharedpreferences = activity.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
if( theme == Helper.THEME_DARK || theme == Helper.THEME_BLACK){
changeDrawableColor(activity, R.drawable.ic_person_add,R.color.dark_text);
changeDrawableColor(activity, R.drawable.ic_person,R.color.dark_text);
changeDrawableColor(activity, R.drawable.ic_cancel,R.color.dark_text);
@ -1863,7 +1867,11 @@ public class Helper {
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if (theme == Helper.THEME_DARK) {
canvas.drawColor(ContextCompat.getColor(context, R.color.mastodonC1));
}else {
}else if( theme == Helper.THEME_BLACK){
canvas.drawColor(ContextCompat.getColor(context, R.color.black));
}
else {
canvas.drawColor(Color.WHITE);
}
}
@ -2035,7 +2043,7 @@ public class Helper {
}
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int resizeSet = sharedpreferences.getInt(Helper.SET_PICTURE_RESIZE, Helper.S_1MO);
int resizeSet = sharedpreferences.getInt(Helper.SET_PICTURE_RESIZE, Helper.S_2MO);
if( mediaType == MediaType.PROFILE)
resizeSet = Helper.S_1MO;
double resizeby = size;

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/black_button_pressed" android:state_pressed="true" />
<item android:drawable="@color/black_button_disabled" android:state_enabled="false" />
<item android:drawable="@color/dark_icon" />
</selector>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dark_icon" />
<stroke android:width="1dp" android:color="@color/black" />
<padding android:left="1dp" android:top="1dp" android:right="1dp"
android:bottom="1dp" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/dark_icon" android:state_checked="true" />
<item android:drawable="@color/dark_icon" android:state_pressed="true" />
<item android:drawable="@color/dark_icon" android:state_focused="true" />
<item android:drawable="@color/black_3" />
</selector>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item android:top="-2dp" android:right="-2dp" android:left="-2dp">
<shape>
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/black" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="@color/black"
android:endColor="@color/black"
android:startColor="@color/black"
android:type="linear" />
</shape>

View File

@ -55,8 +55,9 @@
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/about_developer"
android:textColor="@color/mastodonC4"
android:textSize="16sp"/>
android:textColor="?colorAccent"
android:textSize="16sp"
android:focusable="true" />
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
android:id="@+id/lv_developers"
@ -68,6 +69,16 @@
android:divider="@null"
android:scrollbars="none"/>
<Button
android:id="@+id/about_support"
android:layout_gravity="center"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/support_the_app_on_liberapay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/about_wiki"
android:layout_gravity="center"
@ -91,7 +102,27 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="HardcodedText" />
<!-- About banner designer -->
<TextView
android:id="@+id/about_thanks_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginTop="10dp"
android:padding="5dp"
android:text="@string/thanks_text_banner"
android:textColor="?colorAccent"
android:textSize="16sp"/>
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
android:id="@+id/lv_banners"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginLeft="150dp"
android:layout_marginRight="150dp"
android:divider="@null"
android:scrollbars="none"/>
<!-- About logo designer -->
<TextView
android:id="@+id/about_thanks_logo"
@ -101,7 +132,7 @@
android:layout_marginTop="10dp"
android:padding="5dp"
android:text="@string/thanks_text_logo"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:textSize="16sp"/>
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
@ -125,7 +156,7 @@
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/thanks_text_dev"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:textSize="16sp"/>
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
@ -200,7 +231,8 @@
android:clickable="true"
android:layout_width="200dp"
android:text="@string/about_thekinrar"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
<Button
android:id="@+id/about_thekinrar"

View File

@ -133,7 +133,7 @@
tools:ignore="UselessParent">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"

View File

@ -123,7 +123,7 @@
<TextView
android:id="@+id/toot_space_left"
android:layout_width="0dp"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center"

View File

@ -164,6 +164,20 @@
android:text="@string/set_fit_preview"
android:layout_height="wrap_content" />
<!-- COMPACT MODE -->
<CheckBox
android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:text="@string/set_compact_mode"
android:layout_height="wrap_content" />
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
<CheckBox
android:id="@+id/set_share_details"
android:layout_width="wrap_content"
android:text="@string/set_share_details"
android:layout_height="wrap_content" />
<!-- Resize pictures -->
<LinearLayout
android:layout_marginTop="10dp"
@ -314,15 +328,11 @@
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_night_mode"/>
<android.support.v7.widget.SwitchCompat
android:text="@string/set_theme"/>
<Spinner
android:id="@+id/set_night_mode"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
</LinearLayout>
<!-- TOOTS visibility -->

View File

@ -52,7 +52,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:gravity="center_vertical"
android:text="@string/about_developer"
android:textSize="16sp"/>
@ -63,6 +63,16 @@
android:scrollbars="none"
android:divider="@null"/>
<Button
android:id="@+id/about_support"
android:layout_gravity="center"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/support_the_app_on_liberapay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/about_wiki"
android:layout_gravity="center"
@ -93,7 +103,7 @@
android:layout_marginTop="10dp"
android:id="@+id/about_thanks_banner"
android:layout_width="match_parent"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
@ -113,7 +123,7 @@
android:layout_marginTop="10dp"
android:id="@+id/about_thanks_logo"
android:layout_width="match_parent"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
@ -134,7 +144,7 @@
android:layout_marginTop="10dp"
android:id="@+id/about_thanks_dev"
android:layout_width="match_parent"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"

View File

@ -59,13 +59,32 @@
android:layout_gravity="center"
android:layout_height="wrap_content" />
</RelativeLayout>
<com.github.chrisbanes.photoview.PhotoView
android:visibility="gone"
<FrameLayout
android:layout_centerInParent="true"
android:id="@+id/media_picture"
android:id="@+id/media_picture_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
android:layout_height="match_parent">
<com.github.chrisbanes.photoview.PhotoView
android:visibility="gone"
android:id="@+id/media_picture"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<TextView
android:visibility="gone"
android:gravity="center"
android:id="@+id/media_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dp"
android:background="#AA000000"
android:textColor="#ffffffff"
/>
</FrameLayout>
<VideoView
android:layout_centerInParent="true"
android:visibility="gone"
@ -108,6 +127,7 @@
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_width="30dp"
app:backgroundTint="?colorAccent"
android:layout_height="30dp"
android:src="@drawable/ic_close"
/>
@ -121,6 +141,7 @@
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
app:backgroundTint="?colorAccent"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_save_white"
@ -134,7 +155,7 @@
android:text="@string/media_ready"
android:gravity="center"
android:textSize="14sp"
android:layout_alignBottom="@+id/media_picture"
android:layout_alignBottom="@+id/media_picture_container"
android:layout_marginBottom="40dp"
android:layout_width="match_parent"
android:layout_height="40dp"/>

View File

@ -131,7 +131,7 @@
tools:ignore="UselessParent">
<TextView
android:id="@+id/account_dn"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"

View File

@ -124,7 +124,7 @@
<TextView
android:id="@+id/toot_space_left"
android:layout_width="0dp"
android:textColor="@color/mastodonC4"
android:textColor="?colorAccent"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center"

View File

@ -91,7 +91,7 @@
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_spoiler"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
@ -122,7 +122,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/notification_status_content"
android:layout_marginTop="10dp"
android:textIsSelectable="true"

View File

@ -144,7 +144,7 @@
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_spoiler"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
@ -174,7 +174,7 @@
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_content"
android:textIsSelectable="true"
android:layout_marginTop="10dp"

View File

@ -0,0 +1,674 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Mastalab
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.
Mastalab 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 Mastalab; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:divider="?android:dividerHorizontal"
android:showDividers="end"
android:paddingTop="5dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="60dp"
android:orientation="vertical"
>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true"
android:id="@+id/status_account_profile"
tools:ignore="ContentDescription" />
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:visibility="gone"
android:id="@+id/status_account_profile_boost"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_account_profile_boost_by"
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_marginTop="25dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
style="?attr/shapeBorder"
android:visibility="gone"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/status_account_displayname"
android:visibility="gone"
android:maxLines="1"
android:drawablePadding="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="0dp"
android:layout_weight="1"
android:id="@+id/status_account_username"
android:layout_height="wrap_content" />
<TextView
android:layout_marginStart="2dp"
android:layout_marginLeft="2dp"
android:id="@+id/status_toot_date"
android:layout_width="wrap_content"
android:layout_weight="0"
android:maxLines="1"
android:textSize="12sp"
android:layout_gravity="end"
android:gravity="end"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/status_spoiler_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_spoiler"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/status_spoiler_button"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_remove_red_eye"
android:drawableStart="@drawable/ic_remove_red_eye"
android:gravity="center"
android:drawablePadding="5dp"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:paddingRight="10dp"
android:paddingEnd="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:text="@string/load_attachment_spoiler" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_content_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_content"
android:textIsSelectable="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<android.support.design.widget.FloatingActionButton
android:visibility="gone"
android:id="@+id/status_translate"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_horizontal"
app:fabSize="mini"
android:layout_marginTop="10dp"
android:src="@drawable/ic_translate" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/status_bookmark"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_horizontal"
app:fabSize="mini"
android:src="@drawable/ic_bookmark_border" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_content_translated_container"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/status_content_translated"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/yandex_translate"
android:layout_width="match_parent"
android:padding="2dp"
android:gravity="end"
android:text="Powered by Yandex.Translate"
android:layout_height="wrap_content"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_cardview"
android:padding="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:visibility="gone"
android:background="@drawable/card_border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_gravity="center"
android:id="@+id/status_cardview_image"
android:layout_width="80dp"
android:gravity="center"
android:layout_height="80dp"
tools:ignore="ContentDescription" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:textSize="14sp"
android:maxLines="1"
android:textStyle="bold"
android:id="@+id/status_cardview_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:id="@+id/status_cardview_content"
android:layout_width="match_parent"
android:textSize="12sp"
android:maxLines="4"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/status_cardview_url"
android:layout_marginTop="5dp"
android:textSize="12sp"
android:textStyle="italic"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:visibility="gone"
android:layout_gravity="center"
android:id="@+id/status_cardview_video"
android:layout_width="300dp"
android:layout_height="220dp"
android:layout_margin="10dp"
>
<WebView
android:id="@+id/status_cardview_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
<RelativeLayout
android:id="@+id/status_horizontal_document_container"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="200dp">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev1_h"
android:layout_width="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev1_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
>
<ImageView
android:id="@+id/status_prev2_h"
android:scaleType="fitCenter"
android:layout_width="wrap_content"
android:adjustViewBounds="true"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev2_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev3_h"
android:layout_width="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev3_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev4_h"
android:layout_width="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev4_play_h"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:id="@+id/hide_preview_h"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_remove_red_eye"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/status_document_container"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="200dp"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/status_prev1"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev1_play"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/hide_preview"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_remove_red_eye"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:id="@+id/status_container2"
android:layout_weight="1"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:id="@+id/status_prev2"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:visibility="gone"
android:id="@+id/status_prev2_play"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="2dp"
android:id="@+id/status_container3"
android:layout_height="0dp"
android:baselineAligned="false">
<RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_prev3"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev3_play"
android:layout_centerInParent="true"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:visibility="gone"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:layout_width="0dp"
android:id="@+id/status_prev4_container"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_prev4"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev4_play"
android:layout_centerInParent="true"
android:visibility="gone"
android:layout_width="20dp"
android:src="@drawable/ic_play_arrow"
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/status_show_more"
android:visibility="gone"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_photo"
android:drawableStart="@drawable/ic_photo"
android:gravity="center"
android:drawablePadding="5dp"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:paddingRight="10dp"
android:paddingEnd="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:text="@string/load_attachment" />
</LinearLayout>
<LinearLayout
android:id="@+id/status_spoiler_mention_container"
android:layout_width="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<TextView
android:id="@+id/status_mention_spoiler"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:visibility="gone"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:id="@+id/status_toot_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:layout_gravity="end"
android:gravity="end"
android:layout_marginTop="10dp"
android:textStyle="italic"
android:textSize="16sp"
android:textColor="?attr/colorAccent"
/>
<LinearLayout
android:id="@+id/status_action_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/drawer_padding"
android:layout_marginStart="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:layout_marginEnd="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ProgressBar
android:id="@+id/loader_replies"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:indeterminate="true"
android:layout_width="15dp"
android:layout_height="15dp" />
</LinearLayout>
<ImageView
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:id="@+id/new_element"
android:visibility="gone"
android:src="@drawable/ic_fiber_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<TextView
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_reblog_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:drawablePadding="2dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:id="@+id/status_favorite_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/status_pin"
android:layout_gravity="center_vertical"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_pin_drop"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="end"
android:gravity="end"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:layout_height="wrap_content">
<ImageView
android:layout_marginRight="20dp"
android:layout_marginEnd="20dp"
android:id="@+id/status_privacy"
android:layout_gravity="center_vertical"
android:layout_width="25dp"
android:layout_height="25dp"
tools:ignore="ContentDescription" />
<ImageView
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/status_more"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/ic_more_horiz"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_marginBottom="5dp"
android:layout_marginStart="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:layout_marginEnd="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:id="@+id/status_replies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:id="@+id/status_replies_profile_pictures"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
<Button
android:id="@+id/fetch_more"
android:visibility="gone"
android:textAllCaps="false"
android:drawableLeft="@drawable/ic_expand_more"
android:drawableStart="@drawable/ic_expand_more"
android:gravity="center"
android:layout_gravity="center"
android:drawablePadding="5dp"
android:textStyle="bold"
android:textSize="16sp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:text="@string/fetch_more_toots" />
</LinearLayout>

View File

@ -117,7 +117,7 @@
android:orientation="vertical"
android:visibility="gone"
android:layout_height="wrap_content">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_spoiler"
android:layout_marginTop="10dp"
android:textIsSelectable="true"
@ -147,7 +147,7 @@
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
<fr.gouv.etalab.mastodon.helper.CustomTextView
android:id="@+id/status_content"
android:textIsSelectable="true"
android:layout_marginLeft="10dp"
@ -535,8 +535,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:layout_marginTop="10dp"
android:textStyle="italic"
/>
<TextView
android:layout_marginEnd="20dp"

View File

@ -162,6 +162,21 @@
android:text="@string/set_fit_preview"
android:layout_height="wrap_content" />
<!-- COMPACT MODE -->
<CheckBox
android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:text="@string/set_compact_mode"
android:layout_height="wrap_content" />
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
<CheckBox
android:id="@+id/set_share_details"
android:layout_width="wrap_content"
android:text="@string/set_share_details"
android:layout_height="wrap_content" />
<!-- Resize pictures -->
<LinearLayout
android:layout_marginTop="10dp"
@ -302,6 +317,8 @@
/>
</LinearLayout>
</LinearLayout>
<!-- THEME -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -311,15 +328,11 @@
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_night_mode"/>
<android.support.v7.widget.SwitchCompat
android:text="@string/set_theme"/>
<Spinner
android:id="@+id/set_night_mode"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
</LinearLayout>
<!-- TOOTS visibility -->

View File

@ -37,4 +37,8 @@
android:id="@+id/action_bookmark"
android:title="@string/bookmark_add"
app:showAsAction="never" />
<item
android:id="@+id/action_translate"
android:title="@string/translate"
app:showAsAction="never" />
</menu>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -342,6 +342,11 @@
<item>يانديكس</item>
<item>لا</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>لا</item>
<item>512 ك.ب</item>
@ -488,4 +493,7 @@
<string name="poxy_port">المنفذ</string>
<string name="poxy_login">إسم المستخدم</string>
<string name="poxy_password">كلمة السر</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Contrasenya</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -336,6 +336,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -486,4 +491,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -334,6 +334,11 @@
<item>Yandex</item>
<item>Nein</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Nein</item>
<item>512 Kb</item>
@ -469,4 +474,7 @@ Die Anwendung <b>nutzt keine Trackingwergzeuge</b>(Zielgruppenbestimmung, Fehler
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Passwort</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 KB</item>
@ -475,4 +480,7 @@ Gracias a: </string>
<string name="poxy_port">Puerto</string>
<string name="poxy_login">Usuario</string>
<string name="poxy_password">Contraseña</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Ez</item>
</string-array>
<string-array name="settings_theme">
<item>Iluna</item>
<item>Argia</item>
<item>Beltza</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Ez</item>
<item>512 KB</item>
@ -479,4 +484,7 @@ Eskerrik asko Stéphane logoagatik. </string>
<string name="poxy_port">Ataka</string>
<string name="poxy_login">Saioa</string>
<string name="poxy_password">Pasahitza</string>
<string name="set_theme">Itxura:</string>
<string name="set_compact_mode">Modu trinkoa</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Non</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Non</item>
<item>512 Ko</item>
@ -478,4 +483,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Identifiant</string>
<string name="poxy_password">Mot de passe</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -336,6 +336,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -486,4 +491,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Յանդեքս</item>
<item>Ոչ</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Ոչ</item>
<item>512 կբ</item>
@ -479,4 +484,7 @@
<string name="poxy_port">Պորտ</string>
<string name="poxy_login">Մուտք</string>
<string name="poxy_password">Գաղտնաբառ</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -327,6 +327,11 @@
<item>Yandex</item>
<item>Tidak</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -479,4 +484,7 @@ https://yandex.ru/legal/confidential/?lang=en
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@ Per favore, conferma le notifiche push che vuoi ricevere.
<string name="poxy_port">Porta</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -327,6 +327,11 @@
<item>Yandex</item>
<item>いいえ</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>なし</item>
<item>512 KB</item>
@ -469,4 +474,7 @@
<string name="poxy_port">ポート</string>
<string name="poxy_login">ログイン</string>
<string name="poxy_password">パスワード</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -327,6 +327,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -477,4 +482,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Nee</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Niet</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Poort</string>
<string name="poxy_login">Gebruikersnaam</string>
<string name="poxy_password">Wachtwoord</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Nei</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -472,4 +477,7 @@ Takk til: </string>
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -271,7 +271,7 @@
<!-- Settings -->
<string name="settings_title_optimisation">Optymalizacja ładowania</string>
<string name="set_toots_page">Liczba wpisów do załadowania</string>
<string name="set_accounts_page">Ilość kont do załadowania</string>
<string name="set_accounts_page">Ilość kont do załadowania</string>
<string name="set_notifications_page">Ilość powiadomień do załadowania</string>
<string name="set_attachment_always">Zawsze</string>
<string name="set_attachment_wifi">WiFi</string>
@ -336,6 +336,11 @@
<item>Yandex</item>
<item>Brak</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -483,4 +488,7 @@ Podziękowania dla: </string>
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Hasło</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Não</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -333,6 +333,11 @@
<item>Yandex</item>
<item>Nu</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@ Vă mulțumesc:
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -336,6 +336,11 @@
<item>Яндекс</item>
<item>Нет</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Нет</item>
<item>512 Кб</item>
@ -484,4 +489,7 @@
<string name="poxy_port">Порт</string>
<string name="poxy_login">Логин</string>
<string name="poxy_password">Пароль</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -333,6 +333,11 @@
<item>Yandex</item>
<item>Не</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Не</item>
<item>512 Ko</item>
@ -483,4 +488,7 @@
<string name="poxy_port">Порт</string>
<string name="poxy_login">Пријава</string>
<string name="poxy_password">Лозинка</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -480,4 +485,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -330,6 +330,11 @@
<item>Yandex</item>
<item>Hayır</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Hayır</item>
<item>512KB</item>
@ -473,4 +478,7 @@ Teşekkürler: </string>
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -336,6 +336,11 @@
<item>Яндекс</item>
<item>Ні</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>Ні</item>
<item>512 Кб</item>
@ -476,4 +481,7 @@
<string name="poxy_port">Порт</string>
<string name="poxy_login">Логін</string>
<string name="poxy_password">Пароль</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -329,6 +329,11 @@ và %d toots khác để khám phá</item>
<item>Yandex</item>
<item>Không</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -475,4 +480,7 @@ Cảm ơn bạn: </string>
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -327,6 +327,11 @@
<item>Yandex</item>
<item>否 </item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item></item>
<item>512 Kb</item>
@ -472,4 +477,7 @@ Yandex 有适当的隐私政策可以在这里找到https://yandex.ru/lega
<string name="poxy_port">端口</string>
<string name="poxy_login">登录</string>
<string name="poxy_password">密码</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -327,6 +327,11 @@
<item>Yandex</item>
<item>否 </item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -472,4 +477,7 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
</resources>

View File

@ -34,7 +34,8 @@
<color name="buttonb">#B3E5FC</color>
<color name="titleb">#D7CCC8</color>
<color name="black">#000</color>
<color name="black_2">#050505</color>
<color name="black_3">#222</color>
<!-- Mastodon color scheme -->
<color name="mastodonC1__">#585c67</color>
<color name="mastodonC1___">#454b5b</color>
@ -49,29 +50,23 @@
<color name="mastodonC4_">#1b80c9</color>
<color name="black_button_disabled">#8089A4</color>
<color name="black_button_pressed">#404964</color>
<!-- Primary & accent colors -->
<color name="notif_dark_1">#313543</color>
<color name="notif_dark_2">#353947</color>
<color name="notif_dark_3">#393f4f</color>
<color name="notif_dark_4">#494f5f</color>
<color name="notif_black_1">#050505</color>
<color name="notif_black_2">#151515</color>
<color name="notif_black_3">#202020</color>
<color name="notif_black_4">#252525</color>
<color name="notif_light_1">#efefef</color>
<color name="notif_light_2">#ebf3fa</color>
<color name="notif_light_3">#d9e1e8</color>
<color name="notif_light_4">#c9d1d8</color>
<color name="foreground_material_dark" >@color/mastodonC3__</color>
<color name="foreground_material_light">@color/mastodonC1</color>
<color name="background_material_dark">@color/mastodonC1</color>
<color name="background_material_light">@color/mastodonC3__</color>
<color name="background_floating_material_dark">@color/mastodonC1</color>
<color name="background_floating_material_light">@color/mastodonC3__</color>
<color name="primary_material_dark">@color/mastodonC1</color>
<color name="primary_material_light">@color/mastodonC3__</color>
<color name="primary_dark_material_dark">@color/mastodonC1</color>
<color name="primary_dark_material_light">@color/mastodonC3__</color>
</resources>

View File

@ -352,6 +352,12 @@
<item>No</item>
</string-array>
<string-array name="settings_theme">
<item>Dark</item>
<item>Light</item>
<item>Black</item>
</string-array>
<string-array name="settings_resize_picture">
<item>No</item>
<item>512 Kb</item>
@ -526,6 +532,10 @@
<string name="poxy_port">Port</string>
<string name="poxy_login">Login</string>
<string name="poxy_password">Password</string>
<string name="set_theme">Theme:</string>
<string name="set_compact_mode">Compact mode</string>
<string name="set_share_details">Add toot details when sharing</string>
<string name="support_the_app_on_liberapay">Support the app on Liberapay</string>
<string-array translatable="false" name="proxy_type_choice">
<item>HTTP</item>
<item>SOCKS</item>

View File

@ -31,6 +31,8 @@
<item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3__</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="colorBackgroundFloating">@color/mastodonC3__</item>
<item name="android:colorBackground">@color/mastodonC3__</item>
</style>
<style name="AppTheme_NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
@ -56,9 +58,10 @@
<item name="actionBarTextColor">@color/mastodonC3__</item>
<item name="colorButtonNormal">@color/mastodonC4</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="colorBackgroundFloating">@color/mastodonC3__</item>
<item name="android:colorBackground">@color/mastodonC3__</item>
</style>
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="colorPrimaryDark">@color/transparent</item>
@ -70,6 +73,17 @@
<item name="colorAccent">@color/mastodonC4</item>
</style>
<style name="TransparentBlack" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="colorPrimaryDark">@color/transparent</item>
<item name="colorPrimary">@color/transparent</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="colorAccent">@color/dark_icon</item>
</style>
<style name="DropDownListViewStyle" parent="Base.Widget.AppCompat.ListView.DropDown">
<item name="android:background">@color/mastodonC3__</item>
</style>
@ -115,6 +129,117 @@
</style>
<!-- BLACK theme -->
<style name="AppThemeBlack" parent="Theme.AppCompat">
<item name="android:textColor">@color/dark_text</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/dark_icon</item>
<item name="android:buttonStyle">@style/BlackButtonColor</item>
<item name="headerbg">@style/Header.Black</item>
<item name="android:windowBackground">@color/black</item>
<item name="shapeBorder">@style/Shape.Black</item>
<item name="imgbd">@style/Image.Border.Black</item>
<item name="windowActionModeOverlay">true</item>
<item name="popupOverlay">@style/AppThemeBlack.PopupOverlay</item>
<item name="android:spinnerStyle">@style/BlackSpinnerStyle</item>
<item name="android:spinnerItemStyle">@style/BlackSpinnerItemStyle</item>
<item name="android:popupMenuStyle">@style/BlackPopupMenu</item>
<item name="android:itemBackground">@drawable/menu_selector_black</item>
<item name="android:actionModeStyle">@style/BlackActionMode</item>
<item name="android:dropDownListViewStyle">@style/BlackdropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="colorBackgroundFloating">@color/black_3</item>
<item name="android:colorBackground">@color/black</item>
</style>
<style name="AppThemeBlack_NoActionBar" parent="Theme.AppCompat.NoActionBar">
<item name="android:textColor">@color/dark_text</item>
<item name="android:scrollbarThumbVertical">@color/transparent</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/dark_icon</item>
<item name="android:buttonStyle">@style/BlackButtonColor</item>
<item name="headerbg">@style/Header.Black</item>
<item name="android:windowBackground">@color/black</item>
<item name="shapeBorder">@style/Shape.Black</item>
<item name="imgbd">@style/Image.Border.Black</item>
<item name="windowActionModeOverlay">true</item>
<item name="popupOverlay">@style/AppThemeBlack.PopupOverlay</item>
<item name="windowActionBar">false</item>
<item name="android:spinnerStyle">@style/BlackSpinnerStyle</item>
<item name="android:spinnerItemStyle">@style/BlackSpinnerItemStyle</item>
<item name="android:popupMenuStyle">@style/BlackPopupMenu</item>
<item name="android:itemBackground">@drawable/menu_selector_black</item>
<item name="android:actionModeStyle">@style/BlackActionMode</item>
<item name="android:dropDownListViewStyle">@style/BlackdropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="android:actionBarStyle">@style/BlackActionBarTheme</item>
<item name="colorBackgroundFloating">@color/black_3</item>
<item name="android:colorBackground">@color/black</item>
</style>
<style name="BlackActionBarTheme" parent="Base.Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_3</item>
</style>
<style name="BlackdropDownListViewStyle" parent="Base.Widget.AppCompat.ListView.DropDown">
<item name="android:background">@color/black_3</item>
</style>
<style name="BlackActionMode" parent="Base.Widget.AppCompat.ActionMode">
<item name="android:background">@drawable/menu_selector_black</item>
</style>
<style name="BlackButtonColor" parent="Base.Widget.AppCompat.Button">
<item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/button_selector_black</item>
</style>
<style name="DialogBlack" parent="Theme.AppCompat.Dialog">
<item name="android:windowBackground">@color/black_3</item>
<item name="colorAccent">@color/dark_icon</item>
<item name="android:headerBackground">@color/black_3</item>
<item name="colorControlNormal">@color/mastodonC2</item>
</style>
<style name="BlackPopupMenu" parent="@android:style/Widget.PopupMenu">
<item name="android:windowBackground">@color/black_3</item>
</style>
<style name="BlackSpinnerStyle" parent="Base.Widget.AppCompat.Spinner">
<item name="android:popupBackground">@color/black_3</item>
<item name="android:windowBackground">@color/black_3</item>
<item name="android:colorBackground">@color/black_3</item>
</style>
<style name="BlackSpinnerItemStyle" parent="Base.Widget.AppCompat.TextView.SpinnerItem">
<item name="android:padding">10dp</item>
</style>
<style name="AlertDialogBlack" parent="Theme.AppCompat.Dialog.Alert">
<item name="android:windowBackground">@color/black_3</item>
</style>
<style name="AppThemeBlack.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:windowBackground">@color/black_3</item>
</style>
<style name="Image.Border.Black" parent="AppThemeDark">
<item name="android:background">@drawable/imageview_border_black</item>
</style>
<style name="Header.Black" parent="AppThemeDark">
<item name="android:background">@drawable/side_nav_bar_black</item>
</style>
<style name="Shape.Black" parent="AppThemeDark">
<item name="android:background">@drawable/shape_border_bottom_settings_black</item>
</style>
<!-- Dark theme -->
<style name="AppThemeDark" parent="Theme.AppCompat">
<item name="android:textColor">@color/dark_text</item>
@ -136,6 +261,8 @@
<item name="android:dropDownListViewStyle">@style/DarkdropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="colorBackgroundFloating">@color/mastodonC1</item>
<item name="android:colorBackground">@color/mastodonC1</item>
</style>
<style name="AppThemeDark_NoActionBar" parent="Theme.AppCompat.NoActionBar">
@ -160,6 +287,8 @@
<item name="android:dropDownListViewStyle">@style/DarkdropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="color_in_account_header">@color/mastodonC3</item>
<item name="colorBackgroundFloating">@color/mastodonC1</item>
<item name="android:colorBackground">@color/mastodonC1</item>
</style>
<style name="DarkdropDownListViewStyle" parent="Base.Widget.AppCompat.ListView.DropDown">
@ -185,7 +314,6 @@
<item name="android:windowBackground">@color/mastodonC1</item>
</style>
<style name="DarkSpinnerStyle" parent="Base.Widget.AppCompat.Spinner">
<item name="android:popupBackground">@color/mastodonC1</item>
<item name="android:windowBackground">@color/mastodonC1</item>
@ -195,9 +323,6 @@
<item name="android:padding">10dp</item>
</style>
<style name="AlertDialogDark" parent="Theme.AppCompat.Dialog.Alert">
<item name="android:windowBackground">@color/mastodonC1</item>
</style>
@ -208,7 +333,6 @@
<item name="android:windowBackground">@color/mastodonC1</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
@ -217,19 +341,11 @@
<item name="android:background">@drawable/imageview_border_dark</item>
</style>
<style name="Header.Dark" parent="AppThemeDark">
<item name="android:background">@drawable/side_nav_bar_dark</item>
</style>
<style name="Shape.Dark" parent="AppThemeDark">
<item name="android:background">@drawable/shape_border_bottom_settings_dark</item>
</style>
</resources>