Merged in develop (pull request #45)
This commit is contained in:
commit
4635defa90
|
@ -55,7 +55,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Mastodon.iml" filepath="$PROJECT_DIR$/Mastodon.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/mastodon_etalab.iml" filepath="$PROJECT_DIR$/mastodon_etalab.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -2,6 +2,5 @@
|
|||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -7,8 +7,8 @@ android {
|
|||
applicationId "fr.gouv.etalab.mastodon"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 25
|
||||
versionCode 43
|
||||
versionName "1.4.3"
|
||||
versionCode 44
|
||||
versionName "1.4.4"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
Binary file not shown.
|
@ -23,7 +23,6 @@ import android.os.Bundle;
|
|||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -74,6 +73,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||
private static boolean client_id_for_webview = false;
|
||||
private String instance;
|
||||
private AutoCompleteTextView login_instance;
|
||||
boolean isLoadingInstance = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -105,16 +105,17 @@ public class LoginActivity extends AppCompatActivity {
|
|||
}
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if( s.length() > 2 ){
|
||||
if( s.toString().trim().startsWith("mas") && (!s.toString().trim().contains(".") || s.toString().trim().equals("mastodon.")) )
|
||||
return;
|
||||
if( s.length() > 2 && !isLoadingInstance){
|
||||
String action = "/instances/search";
|
||||
RequestParams parameters = new RequestParams();
|
||||
parameters.add("q", s.toString().trim());
|
||||
parameters.add("count", String.valueOf(5));
|
||||
parameters.add("name", String.valueOf(true));
|
||||
isLoadingInstance = true;
|
||||
new KinrarClient().get(action, parameters, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
|
||||
isLoadingInstance = false;
|
||||
String response = new String(responseBody);
|
||||
String[] instances;
|
||||
try {
|
||||
|
@ -132,12 +133,14 @@ public class LoginActivity extends AppCompatActivity {
|
|||
ArrayAdapter<String> adapter =
|
||||
new ArrayAdapter<>(LoginActivity.this, android.R.layout.simple_list_item_1, instances);
|
||||
login_instance.setAdapter(adapter);
|
||||
login_instance.showDropDown();
|
||||
if( login_instance.hasFocus())
|
||||
login_instance.showDropDown();
|
||||
|
||||
} catch (JSONException ignored) {}
|
||||
} catch (JSONException ignored) {isLoadingInstance = false;}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
|
||||
isLoadingInstance = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import android.support.v7.app.AppCompatActivity;
|
|||
import android.text.Editable;
|
||||
import android.text.Html;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -103,8 +104,8 @@ import fr.gouv.etalab.mastodon.interfaces.OnRetrieveAttachmentInterface;
|
|||
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveSearcAccountshInterface;
|
||||
import fr.gouv.etalab.mastodon.jobs.ScheduledTootsSyncJob;
|
||||
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
||||
import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO;
|
||||
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
||||
import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO;
|
||||
import mastodon.etalab.gouv.fr.mastodon.R;
|
||||
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT;
|
||||
|
@ -336,8 +337,21 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
|||
toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
|
||||
}else {
|
||||
if( tootReply == null){
|
||||
visibility = "public";
|
||||
toot_visibility.setImageResource(R.drawable.ic_action_globe);
|
||||
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
|
||||
switch (visibility) {
|
||||
case "public":
|
||||
toot_visibility.setImageResource(R.drawable.ic_action_globe);
|
||||
break;
|
||||
case "unlisted":
|
||||
toot_visibility.setImageResource(R.drawable.ic_action_lock_open);
|
||||
break;
|
||||
case "private":
|
||||
toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
|
||||
break;
|
||||
case "direct":
|
||||
toot_visibility.setImageResource(R.drawable.ic_local_post_office);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -967,7 +981,19 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
|||
//Retrieves attachments
|
||||
restored = id;
|
||||
attachments = status.getMedia_attachments();
|
||||
toot_picture_container.removeAllViews();
|
||||
int childCount = toot_picture_container.getChildCount();
|
||||
ArrayList<ImageView> toRemove = new ArrayList<>();
|
||||
if( childCount > 0 ){
|
||||
for(int i = 0 ; i < childCount ; i++){
|
||||
if( toot_picture_container.getChildAt(i) instanceof ImageView)
|
||||
toRemove.add((ImageView) toot_picture_container.getChildAt(i));
|
||||
}
|
||||
if( toRemove.size() > 0){
|
||||
for(ImageView imageView: toRemove)
|
||||
toot_picture_container.removeView(imageView);
|
||||
}
|
||||
toRemove.clear();
|
||||
}
|
||||
loading_picture.setVisibility(View.GONE);
|
||||
if( attachments != null && attachments.size() > 0){
|
||||
toot_picture_container.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -52,7 +52,7 @@ import static fr.gouv.etalab.mastodon.helper.Helper.manageDownloads;
|
|||
public class WebviewActivity extends AppCompatActivity {
|
||||
|
||||
private String url;
|
||||
|
||||
private WebView webView;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -74,7 +74,7 @@ public class WebviewActivity extends AppCompatActivity {
|
|||
if( getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
WebView webView = Helper.initializeWebview(WebviewActivity.this, R.id.webview);
|
||||
webView = Helper.initializeWebview(WebviewActivity.this, R.id.webview);
|
||||
|
||||
setTitle("");
|
||||
FrameLayout webview_container = (FrameLayout) findViewById(R.id.webview_container);
|
||||
|
@ -146,6 +146,15 @@ public class WebviewActivity extends AppCompatActivity {
|
|||
this.url = newUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView.canGoBack()){
|
||||
webView.goBack();
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
|
|
|
@ -1065,7 +1065,7 @@ public class API {
|
|||
RequestParams params = new RequestParams();
|
||||
params.put("file", inputStream);
|
||||
|
||||
post("/media", 120000, params, new JsonHttpResponseHandler() {
|
||||
post("/media", 240000, params, new JsonHttpResponseHandler() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class KinrarClient {
|
|||
|
||||
|
||||
private String getAbsoluteUrl(String action) {
|
||||
return "https://instances.social/api/1.0/" + action;
|
||||
return "https://instances.social/api/1.0" + action;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -365,6 +365,8 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
|
|||
|
||||
}else {
|
||||
holder.notification_status_container.setVisibility(View.GONE);
|
||||
holder.notification_account_username.setCompoundDrawables( null, null, null, null);
|
||||
holder.card_status_container.setOnClickListener(null);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -63,21 +63,22 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import fr.gouv.etalab.mastodon.activities.MediaActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowConversationActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.TootActivity;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Error;
|
||||
import fr.gouv.etalab.mastodon.client.PatchBaseImageDownloader;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.interfaces.OnTranslatedInterface;
|
||||
import fr.gouv.etalab.mastodon.translation.YandexQuery;
|
||||
import mastodon.etalab.gouv.fr.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.PostActionAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.client.API;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Attachment;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Error;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
||||
import fr.gouv.etalab.mastodon.client.PatchBaseImageDownloader;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.interfaces.OnPostActionInterface;
|
||||
import fr.gouv.etalab.mastodon.interfaces.OnTranslatedInterface;
|
||||
import fr.gouv.etalab.mastodon.translation.YandexQuery;
|
||||
import mastodon.etalab.gouv.fr.mastodon.R;
|
||||
|
||||
import static fr.gouv.etalab.mastodon.activities.MainActivity.currentLocale;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
||||
|
||||
|
@ -505,6 +506,31 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
holder.status_show_more.setVisibility(View.GONE);
|
||||
status.setAttachmentShown(true);
|
||||
statusListAdapter.notifyDataSetChanged();
|
||||
|
||||
/*
|
||||
Added a Countdown Timer, so that Sensitive (NSFW)
|
||||
images only get displayed for user set time,
|
||||
giving the user time to click on them to expand them,
|
||||
if they want. Images are then hidden again.
|
||||
-> Default value is set to 5 seconds
|
||||
*/
|
||||
final int timeout = sharedpreferences.getInt(Helper.SET_NSFW_TIMEOUT, 5);
|
||||
|
||||
if (timeout > 0) {
|
||||
|
||||
new CountDownTimer((timeout * 1000), 1000) {
|
||||
|
||||
public void onTick(long millisUntilFinished) {
|
||||
}
|
||||
|
||||
public void onFinish() {
|
||||
status.setAttachmentShown(false);
|
||||
holder.status_show_more.setVisibility(View.VISIBLE);
|
||||
|
||||
statusListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -13,13 +13,17 @@ package fr.gouv.etalab.mastodon.fragments;
|
|||
*
|
||||
* 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.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -28,23 +32,32 @@ import android.provider.DocumentsContract;
|
|||
import android.provider.MediaStore;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import fr.gouv.etalab.mastodon.activities.MainActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.TootActivity;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
||||
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
||||
import mastodon.etalab.gouv.fr.mastodon.R;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_THEME_INTENT;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.loadPPInActionBar;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.updateHeaderAccountInfo;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -61,7 +74,7 @@ public class SettingsFragment extends Fragment {
|
|||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View rootView = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
final View rootView = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
context = getContext();
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
||||
|
@ -213,9 +226,135 @@ public class SettingsFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
// NSFW Timeout
|
||||
SeekBar nsfwTimeoutSeekBar = (SeekBar) rootView.findViewById(R.id.set_nsfw_timeout);
|
||||
final TextView set_nsfw_timeout_value = (TextView) rootView.findViewById(R.id.set_nsfw_timeout_value);
|
||||
|
||||
nsfwTimeoutSeekBar.setMax(30);
|
||||
|
||||
int nsfwTimeout = sharedpreferences.getInt(Helper.SET_NSFW_TIMEOUT, 5);
|
||||
|
||||
nsfwTimeoutSeekBar.setProgress(nsfwTimeout);
|
||||
set_nsfw_timeout_value.setText(String.valueOf(nsfwTimeout));
|
||||
|
||||
nsfwTimeoutSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
|
||||
set_nsfw_timeout_value.setText(String.valueOf(progress));
|
||||
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putInt(Helper.SET_NSFW_TIMEOUT, progress);
|
||||
editor.apply();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
LinearLayout toot_visibility_container = (LinearLayout) rootView.findViewById(R.id.toot_visibility_container);
|
||||
String prefKeyOauthTokenT = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
final Account account = new AccountDAO(context, db).getAccountByToken(prefKeyOauthTokenT);
|
||||
final ImageView set_toot_visibility = (ImageView) rootView.findViewById(R.id.set_toot_visibility);
|
||||
//Only displayed for non locked accounts
|
||||
if (account != null && !account.isLocked()) {
|
||||
String tootVisibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
|
||||
switch (tootVisibility) {
|
||||
case "public":
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_globe);
|
||||
break;
|
||||
case "unlisted":
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_lock_open);
|
||||
break;
|
||||
case "private":
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
|
||||
break;
|
||||
case "direct":
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_local_post_office);
|
||||
break;
|
||||
}
|
||||
changeColor();
|
||||
}else {
|
||||
toot_visibility_container.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
set_toot_visibility.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
|
||||
dialog.setTitle(R.string.toot_visibility_tilte);
|
||||
final String[] stringArray = getResources().getStringArray(R.array.toot_visibility);
|
||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, stringArray);
|
||||
dialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int position) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int position) {
|
||||
String visibility = "public";
|
||||
|
||||
switch (position){
|
||||
case 0:
|
||||
visibility = "public";
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_globe);
|
||||
break;
|
||||
case 1:
|
||||
visibility = "unlisted";
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_lock_open);
|
||||
break;
|
||||
case 2:
|
||||
visibility = "private";
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
|
||||
break;
|
||||
case 3:
|
||||
visibility = "direct";
|
||||
set_toot_visibility.setImageResource(R.drawable.ic_local_post_office);
|
||||
break;
|
||||
}
|
||||
if( account != null) {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), visibility);
|
||||
editor.apply();
|
||||
Toast.makeText(context, context.getString(R.string.toast_visibility_changed, "@" + account.getAcct() + "@" + account.getInstance()), Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(context, R.string.toast_error,Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
changeColor();
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
||||
private void changeColor(){
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
if( theme == Helper.THEME_DARK){
|
||||
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_local_post_office,R.color.dark_text);
|
||||
}else {
|
||||
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_local_post_office,R.color.black);
|
||||
}
|
||||
|
||||
}
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
|
|
@ -52,8 +52,6 @@ import android.text.Html;
|
|||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
import android.text.method.ArrowKeyMovementMethod;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Patterns;
|
||||
|
@ -115,6 +113,7 @@ import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
|
|||
import fr.gouv.etalab.mastodon.activities.TootActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.WebviewActivity;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.RemoveAccountAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.client.API;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Mention;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
||||
|
@ -122,7 +121,6 @@ import fr.gouv.etalab.mastodon.client.PatchBaseImageDownloader;
|
|||
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
||||
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
||||
import mastodon.etalab.gouv.fr.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.client.API;
|
||||
|
||||
import static android.app.Notification.DEFAULT_SOUND;
|
||||
import static android.app.Notification.DEFAULT_VIBRATE;
|
||||
|
@ -185,6 +183,7 @@ public class Helper {
|
|||
public static final String SET_TIME_TO = "set_time_to";
|
||||
public static final String SET_AUTO_STORE = "set_auto_store";
|
||||
public static final String SET_POPUP_PUSH = "set_popup_push";
|
||||
public static final String SET_NSFW_TIMEOUT = "set_nsfw_timeout";
|
||||
public static final int ATTACHMENT_ALWAYS = 1;
|
||||
public static final int ATTACHMENT_WIFI = 2;
|
||||
public static final int ATTACHMENT_ASK = 3;
|
||||
|
@ -206,6 +205,7 @@ public class Helper {
|
|||
public static final String SET_JAVASCRIPT = "set_javascript";
|
||||
public static final String SET_COOKIES = "set_cookies";
|
||||
public static final String SET_FOLDER_RECORD = "set_folder_record";
|
||||
public static final String SET_TOOT_VISIBILITY = "set_toot_visibility";
|
||||
|
||||
//End points
|
||||
public static final String EP_AUTHORIZE = "/oauth/authorize";
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
<?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>.
|
||||
-->
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- Listview status -->
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/lv_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null"
|
||||
>
|
||||
</ListView>
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/no_action"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="25sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold"
|
||||
android:typeface="serif"
|
||||
android:text="@string/no_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next status -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_next_status"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:layout_height="20dp">
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,165 @@
|
|||
<?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>
|
||||
-->
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="mastodon.etalab.gouv.fr.mastodon.fr.etalab.gouv.fr.mastodon.activities.MainActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="?attr/popupOverlay">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pp_actionBar"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:gravity="center_vertical"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<android.support.v7.widget.SearchView
|
||||
android:id="@+id/toolbar_search"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="end"/>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
app:tabGravity="fill"
|
||||
app:tabMaxWidth="0dp"
|
||||
app:tabSelectedTextColor="?attr/colorAccent">
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tab_home"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/ic_action_home_tl"/>
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tab_local"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/ic_action_users_tl"/>
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tab_global"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/ic_action_globe_tl"/>
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tab_notification"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/ic_notifications_tl"/>
|
||||
</android.support.design.widget.TabLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
|
||||
<!-- Framelayout to display Fragments -->
|
||||
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/viewpager"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="mastodon.etalab.gouv.fr.mastodon.fr.etalab.gouv.fr.mastodon.activities.MainActivity"
|
||||
>
|
||||
</android.support.v4.view.ViewPager>
|
||||
|
||||
<!-- Framelayout to display Fragments -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/main_app_container"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="mastodon.etalab.gouv.fr.mastodon.fr.etalab.gouv.fr.mastodon.activities.MainActivity"
|
||||
>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/toot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/ic_action_edit" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
|
@ -0,0 +1,64 @@
|
|||
<?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"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<ListView
|
||||
android:id="@+id/lv_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null"
|
||||
>
|
||||
</ListView>
|
||||
<RelativeLayout
|
||||
android:id="@+id/no_result"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="25sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold"
|
||||
android:typeface="serif"
|
||||
android:text="@string/no_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Framelayout to display Fragments -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main_app_container"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="fr.gouv.etalab.mastodon.activities.ShowConversationActivity"
|
||||
>
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:visibility="gone"
|
||||
android:id="@+id/lv_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null" />
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,171 @@
|
|||
<?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>.
|
||||
-->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:fillViewport="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
<LinearLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:orientation="vertical">
|
||||
<EditText
|
||||
android:id="@+id/toot_cw_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone"
|
||||
android:maxLines="1"
|
||||
android:hint="@string/toot_cw_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/toot_reply_content_container"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/toot_reply_content_title"
|
||||
android:text="@string/toot_reply_content_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:layout_below="@+id/toot_reply_content_title"
|
||||
android:id="@+id/toot_reply_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="top|start"
|
||||
android:maxLines="4"
|
||||
android:textStyle="italic"
|
||||
android:autoLink="web"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginRight="40dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/toot_close_reply"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
app:fabSize="mini"
|
||||
android:layout_margin="5dp"
|
||||
app:srcCompat="@drawable/ic_close" />
|
||||
</RelativeLayout>
|
||||
<AutoCompleteTextView
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/toot_content"
|
||||
android:gravity="top|start"
|
||||
android:inputType="textMultiLine|textCapSentences"
|
||||
android:hint="@string/toot_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:minLines="4"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="0dp" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/picture_scrollview"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:id="@+id/toot_picture_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="100dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_picture"
|
||||
android:visibility="gone"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:indeterminate="true" />
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageButton
|
||||
android:id="@+id/toot_picture"
|
||||
android:padding="5dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_action_camera"
|
||||
tools:ignore="ContentDescription" />
|
||||
<ImageButton
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:id="@+id/toot_visibility"
|
||||
android:padding="5dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_action_globe"
|
||||
tools:ignore="ContentDescription" />
|
||||
<Button
|
||||
android:id="@+id/toot_cw"
|
||||
android:padding="5dp"
|
||||
android:text="@string/cw"
|
||||
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp" />
|
||||
<TextView
|
||||
android:id="@+id/toot_space_left"
|
||||
android:layout_width="0dp"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="40dp" />
|
||||
<Button
|
||||
android:id="@+id/toot_it"
|
||||
android:padding="5dp"
|
||||
android:text="@string/toot_it"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="center"
|
||||
style="@style/Base.Widget.AppCompat.Button.Colored"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
<CheckBox
|
||||
android:text="@string/toot_sensitive"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/toot_sensitive"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -0,0 +1,84 @@
|
|||
<?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>.
|
||||
-->
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- Listview Accounts -->
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/lv_accounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null"
|
||||
>
|
||||
</ListView>
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/no_action"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/no_action_text"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="25sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold"
|
||||
android:typeface="serif"
|
||||
android:text="@string/no_accounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next accounts -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_next_accounts"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:layout_height="20dp">
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?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>.
|
||||
-->
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- Listview Notifications -->
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/lv_notifications"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null"
|
||||
>
|
||||
</ListView>
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/no_action"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="25sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold"
|
||||
android:typeface="serif"
|
||||
android:text="@string/no_notifications"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next notifications -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_next_notifications"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:layout_height="20dp">
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
<?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>.
|
||||
-->
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:paddingLeft="@dimen/drawer_padding"
|
||||
android:paddingRight="@dimen/drawer_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/fab_margin"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/set_share_validation"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/set_share_validation"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/set_show_error_messages"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/set_show_error_messages"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/set_show_reply"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/set_display_reply"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/set_auto_store"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/set_auto_store_toot"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/file_chooser"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:maxLines="1"
|
||||
android:text="@string/set_folder_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="2"
|
||||
android:textStyle="italic"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:id="@+id/set_folder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="italic"
|
||||
android:text="@string/click_to_change"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/set_embedded_browser"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/embedded_browser"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/set_javascript_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_javascript"/>
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/set_javascript"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/set_cookies_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_cookies"/>
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/set_cookies"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
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: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"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- TOOTS visibility -->
|
||||
<LinearLayout
|
||||
android:id="@+id/toot_visibility_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/toots_visibility_tilte"/>
|
||||
<ImageButton
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:id="@+id/set_toot_visibility"
|
||||
android:padding="5dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_action_globe"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
<!-- NSFW Timeout -->
|
||||
<TextView
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/set_nsfw_timeout"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_nsfw_timeout_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_nsfw_timeout"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
<?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>.
|
||||
-->
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:paddingLeft="@dimen/drawer_padding"
|
||||
android:paddingRight="@dimen/drawer_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/fab_margin"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<!-- OPTIMIZATION SETTINGS -->
|
||||
<TextView
|
||||
android:text="@string/settings_title_optimisation"
|
||||
style="?attr/shapeBorder"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<!-- Toots per page -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:typeface="serif"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="italic"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/set_toots_page"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_toots_page_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_toots_per_page"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
<!-- Accounts per page -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:typeface="serif"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="italic"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/set_accounts_page"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_accounts_page_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_accounts_per_page"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
<!-- Notifications per page -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:typeface="serif"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="italic"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/set_notifications_page"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_notifications_page_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_notifications_per_page"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
<!-- Attachment behavior -->
|
||||
<TextView
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="@string/set_attachment_action"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<RadioGroup
|
||||
android:id="@+id/set_attachment_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<RadioButton android:id="@+id/set_attachment_always"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/set_attachment_always"
|
||||
/>
|
||||
<RadioButton android:id="@+id/set_attachment_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/set_attachment_wifi"
|
||||
/>
|
||||
<RadioButton android:id="@+id/set_attachment_ask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/set_attachment_ask"
|
||||
/>
|
||||
</RadioGroup>
|
||||
<!-- MORE OPTIONS SETTINGS -->
|
||||
|
||||
<!-- END OPTIMIZATION SETTINGS -->
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<?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>.
|
||||
-->
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/fab_margin"
|
||||
android:paddingRight="@dimen/fab_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- Listview status -->
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/swipeContainer"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/lv_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null" />
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/no_action"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="25sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold"
|
||||
android:typeface="serif"
|
||||
android:text="@string/no_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
<!-- Main Loader -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loader"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next status -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_next_status"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:layout_height="20dp">
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?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>.
|
||||
-->
|
||||
<android.support.design.widget.AppBarLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@null"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
app:tabGravity="fill"
|
||||
app:tabMaxWidth="0dp"
|
||||
/>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
|
@ -32,7 +32,7 @@
|
|||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/media_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageView
|
||||
|
|
|
@ -80,14 +80,13 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/toot_content"
|
||||
android:gravity="top|start"
|
||||
android:inputType="textMultiLine"
|
||||
android:inputType="textMultiLine|textCapSentences"
|
||||
android:hint="@string/toot_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:minLines="4"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="0dp" />
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
|
|
@ -32,14 +32,15 @@
|
|||
android:id="@+id/main_container"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_marginTop="5dp"
|
||||
android:id="@+id/notification_account_profile"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal|top"
|
||||
tools:ignore="ContentDescription" />
|
||||
<ImageView
|
||||
|
|
|
@ -166,6 +166,54 @@
|
|||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- TOOTS visibility -->
|
||||
<LinearLayout
|
||||
android:id="@+id/toot_visibility_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/toots_visibility_tilte"/>
|
||||
<ImageButton
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:id="@+id/set_toot_visibility"
|
||||
android:padding="5dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_action_globe"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
<!-- NSFW Timeout -->
|
||||
<TextView
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/set_nsfw_timeout"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_nsfw_timeout_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_nsfw_timeout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@
|
|||
<string name="toot_delete_media">Supprimer le média ?</string>
|
||||
<string name="toot_error_no_content">Votre pouet est vide !</string>
|
||||
<string name="toot_visibility_tilte">Visibilité du pouet</string>
|
||||
<string name="toots_visibility_tilte">Visibilité des pouets par défaut : </string>
|
||||
<string name="toot_sent">Le pouet a été envoyé !</string>
|
||||
<string name="toot_reply_content_title">Vous répondez à ce pouet :</string>
|
||||
<string name="toot_sensitive">Contenu sensible ?</string>
|
||||
|
@ -252,6 +253,7 @@
|
|||
<string name="toast_saved">Le média a été enregistré !</string>
|
||||
<string name="toast_error_translate">Une erreur est survenue lors de la traduction !</string>
|
||||
<string name="toast_toot_saved">Brouillon enregistré !</string>
|
||||
<string name="toast_visibility_changed">La visibilité des pouets a été changée pour le compte %1$s</string>
|
||||
<!-- Settings -->
|
||||
<string name="settings_title_optimisation">Optimisation du chargement</string>
|
||||
<string name="set_toots_page">Nombre de pouets par chargement</string>
|
||||
|
@ -279,6 +281,7 @@
|
|||
<string name="set_wifi_only">Notifier en WIFI seulement</string>
|
||||
<string name="set_notif_silent">Utiliser le vibreur</string>
|
||||
<string name="set_night_mode">Mode nuit</string>
|
||||
<string name="set_nsfw_timeout">Délai d\'affichage NSFW (en secondes, 0 signifie aucun délai)</string>
|
||||
<string name="settings_title_profile">Modifier le profil</string>
|
||||
<string name="set_profile_description">Présentation…</string>
|
||||
<string name="set_save_changes">Enregistrer les modifications</string>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="drawer_padding">5dp</dimen>
|
||||
<dimen name="toot_padding">200dp</dimen>
|
||||
<dimen name="fab_margin">100dp</dimen>
|
||||
<dimen name="activity_vertical_margin">20dp</dimen>
|
||||
<dimen name="activity_padding_top_header">15dp</dimen>
|
||||
<dimen name="drawer_padding">20dp</dimen>
|
||||
<dimen name="toot_padding">20dp</dimen>
|
||||
<dimen name="fab_margin">20dp</dimen>
|
||||
<dimen name="activity_vertical_margin">30dp</dimen>
|
||||
<dimen name="activity_padding_top_header">16dp</dimen>
|
||||
</resources>
|
|
@ -160,6 +160,7 @@
|
|||
<string name="toot_delete_media">Delete this media?</string>
|
||||
<string name="toot_error_no_content">Your toot is empty!</string>
|
||||
<string name="toot_visibility_tilte">Visibility of the toot</string>
|
||||
<string name="toots_visibility_tilte">Visibility of the toots by default: </string>
|
||||
<string name="toot_sent">The toot has been sent!</string>
|
||||
<string name="toot_reply_content_title">You are replying to this toot:</string>
|
||||
<string name="toot_sensitive">Sensitive content?</string>
|
||||
|
@ -258,7 +259,7 @@
|
|||
<string name="toast_saved">The media has been saved!</string>
|
||||
<string name="toast_error_translate">An error occurred while translating!</string>
|
||||
<string name="toast_toot_saved">Draft saved!</string>
|
||||
|
||||
<string name="toast_visibility_changed">Visibility of the toots has been changed for the account %1$s</string>
|
||||
<!-- Settings -->
|
||||
<string name="settings_title_optimisation">Optimisation of loading</string>
|
||||
<string name="set_toots_page">Number of toots per load</string>
|
||||
|
@ -285,6 +286,7 @@
|
|||
<string name="set_wifi_only">Notify in WIFI only</string>
|
||||
<string name="set_notif_silent">Silent Notifications</string>
|
||||
<string name="set_night_mode">Night mode</string>
|
||||
<string name="set_nsfw_timeout">NSFW view timeout (seconds, 0 means off)</string>
|
||||
<string name="settings_title_profile">Edit profile</string>
|
||||
<string name="set_profile_description">Bio…</string>
|
||||
<string name="set_save_changes">Save changes</string>
|
||||
|
|
Loading…
Reference in New Issue