parent
a7461d65d0
commit
34f08f9c3b
|
@ -8,10 +8,10 @@
|
|||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/shitter"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:allowBackup="false"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity
|
||||
|
@ -26,12 +26,13 @@
|
|||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:pathPattern="\\/.*\\/status\\/.*"
|
||||
android:host="*.twitter.com"
|
||||
android:pathPattern="\\/.*\\/status\\/.*"
|
||||
android:scheme="https" />
|
||||
|
||||
</intent-filter>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.nuclearfog.twidda.backend;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -13,6 +14,7 @@ abstract class ErrorHandling {
|
|||
|
||||
/**
|
||||
* Print twitter error message
|
||||
*
|
||||
* @param c Application Context
|
||||
* @param error TwitterException
|
||||
* @return if Activity should shut down
|
||||
|
@ -20,18 +22,25 @@ abstract class ErrorHandling {
|
|||
public static boolean printError(Context c, @NonNull TwitterException error) {
|
||||
|
||||
switch (error.getErrorCode()) {
|
||||
|
||||
case 88:
|
||||
case 420: //
|
||||
case 429: // Rate limit exceeded!
|
||||
Toast.makeText(c, R.string.rate_limit_exceeded, Toast.LENGTH_SHORT).show();
|
||||
String msg = c.getString(R.string.rate_limit_exceeded);
|
||||
msg += error.getRetryAfter();
|
||||
Toast.makeText(c, msg, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 17:
|
||||
case 50: // USER not found
|
||||
case 63: // USER suspended
|
||||
case 136: // Blocked!
|
||||
Toast.makeText(c, R.string.user_not_found, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
|
||||
case 32:
|
||||
Toast.makeText(c, R.string.authentication_failed, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 34: //
|
||||
case 144: // TWEET not found
|
||||
Toast.makeText(c, R.string.tweet_not_found, Toast.LENGTH_SHORT).show();
|
||||
|
@ -41,13 +50,35 @@ abstract class ErrorHandling {
|
|||
Toast.makeText(c, R.string.cant_send_dm, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case -1:
|
||||
Toast.makeText(c, R.string.error_not_specified, Toast.LENGTH_SHORT).show();
|
||||
case 179:
|
||||
Toast.makeText(c, R.string.status_private, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 186:
|
||||
Toast.makeText(c, R.string.status_too_long, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 187:
|
||||
Toast.makeText(c, R.string.duplicate_status, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 354:
|
||||
Toast.makeText(c, R.string.directmessage_too_long, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case 89:
|
||||
Toast.makeText(c, R.string.error_accesstoken, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case -1:
|
||||
default:
|
||||
ConnectivityManager mConnect = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (mConnect.getActiveNetworkInfo() == null || !mConnect.getActiveNetworkInfo().isConnected()) {
|
||||
Toast.makeText(c, R.string.connection_failed, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(c, error.getErrorMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -371,7 +371,6 @@ public class TwitterEngine {
|
|||
* @param text Tweet Text
|
||||
* @param reply In reply to tweet ID
|
||||
* @param path Path to the Media File
|
||||
|
||||
* @throws TwitterException if Access is unavailable
|
||||
*/
|
||||
public void sendStatus(String text, long reply, @Nullable String[] path) throws TwitterException {
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/pin"
|
||||
android:inputType="numberPassword"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="numberPassword"
|
||||
android:singleLine="true"
|
||||
tools:targetApi="o" />
|
||||
|
||||
|
@ -50,8 +50,8 @@
|
|||
android:layout_height="@dimen/button_size"
|
||||
android:layout_marginStart="@dimen/layout_margin"
|
||||
android:layout_marginLeft="@dimen/layout_margin"
|
||||
android:contentDescription="@string/paste_from_clipboard"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/paste_from_clipboard"
|
||||
app:srcCompat="@drawable/copy" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.v7.widget.CardView 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"
|
||||
style="@style/PopupCardView"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.v7.widget.CardView 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"
|
||||
style="@style/PopupCardView"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<string name="pin_added">PIN eingefügt!</string>
|
||||
<string name="false_format">Falsches Format!</string>
|
||||
<string name="delete_database_popup">Datenbank löschen?</string>
|
||||
<string name="rate_limit_exceeded">Abrufgrenze überschritten!</string>
|
||||
<string name="rate_limit_exceeded">"Rate-Limit erreicht, weiter in (s): "</string>
|
||||
<string name="error_sending_tweet">Fehler beim Senden!</string>
|
||||
<string name="tweet_sent">Tweet gesendet</string>
|
||||
<string name="error">Fehler!</string>
|
||||
|
@ -58,7 +58,6 @@
|
|||
<string name="error_dm">Nutzername oder Nachricht eingeben!</string>
|
||||
<string name="abort">Abgebrochen!</string>
|
||||
<string name="cancel_message">Nachricht verwerfen?</string>
|
||||
<string name="error_not_specified">Allgemeiner Fehler!</string>
|
||||
<string name="empty_tweet">Tweet leer!</string>
|
||||
<string name="logout">ausloggen</string>
|
||||
<string name="pin_verification_failed">PIN verifizierung fehlgeschlagen!</string>
|
||||
|
@ -71,11 +70,8 @@
|
|||
<string name="confirm_unfollow">User entfolgen?</string>
|
||||
<string name="confirm_block">user sperren?</string>
|
||||
<string name="confirm_delete_dm">Nachricht löschen?</string>
|
||||
<string name="dm_not_found">Nachricht nicht gefunden!</string>
|
||||
<string name="image_folder_created">Ordner erstellt unter Pictures</string>
|
||||
<string name="image_saved">Bild gespeichert!</string>
|
||||
<string name="tweet_loading">lädt..</string>
|
||||
<string name="site_load_failure">Fehler beim Abrufen der Seite!</string>
|
||||
<string name="tweet_close">Tweetfenster schließen</string>
|
||||
<string name="send_tweet">Tweet senden</string>
|
||||
<string name="add_image">Bild hinzufügen</string>
|
||||
|
@ -96,4 +92,10 @@
|
|||
<string name="user_not_found">Nutzer nicht gefunden!</string>
|
||||
<string name="profile_tweets">Profile tweets</string>
|
||||
<string name="cant_send_dm">Nachricht kann nicht an den User gesendet werden!</string>
|
||||
<string name="error_accesstoken">ungültiger Zugangsschlüssel!</string>
|
||||
<string name="status_private">keine Berechtigung um den Status zu sehen!</string>
|
||||
<string name="status_too_long">Status ist zu lang!</string>
|
||||
<string name="duplicate_status">Tweet wurde schon versendet!</string>
|
||||
<string name="directmessage_too_long">Direktnachricht länge überschritten!</string>
|
||||
<string name="authentication_failed">Authentifikation fehlgeschlagen!</string>
|
||||
</resources>
|
|
@ -37,7 +37,7 @@
|
|||
<string name="pin_added">PIN added!</string>
|
||||
<string name="false_format">not valid!</string>
|
||||
<string name="delete_database_popup">delete database?</string>
|
||||
<string name="rate_limit_exceeded">Rate limit exceeded</string>
|
||||
<string name="rate_limit_exceeded">"Rate limit exceeded, retry after(s): "</string>
|
||||
<string name="error_sending_tweet">error while sending</string>
|
||||
<string name="tweet_sent">tweet sent</string>
|
||||
<string name="error">Error!</string>
|
||||
|
@ -66,7 +66,6 @@
|
|||
<string name="error_dm">enter username or message!</string>
|
||||
<string name="abort">canceled!</string>
|
||||
<string name="cancel_message">cancel message?</string>
|
||||
<string name="error_not_specified">not specidfied error!</string>
|
||||
<string name="empty_tweet">empty tweet!</string>
|
||||
<string name="logout">log out!</string>
|
||||
<string name="pin_verification_failed">PIN verification failed!</string>
|
||||
|
@ -79,11 +78,8 @@
|
|||
<string name="confirm_block">block user?</string>
|
||||
<string name="confirm_log_lout">log out?</string>
|
||||
<string name="confirm_cancel_tweet">cancel tweet?</string>
|
||||
<string name="dm_not_found">message not found!</string>
|
||||
<string name="image_folder_created">folder created under Pictures!</string>
|
||||
<string name="image_saved">image saved!</string>
|
||||
<string name="tweet_loading">loading..</string>
|
||||
<string name="site_load_failure">error while loading site!</string>
|
||||
<string name="image_preview">Image preview</string>
|
||||
<string name="add_image">add new image</string>
|
||||
<string name="send_tweet">send Tweet</string>
|
||||
|
@ -104,4 +100,10 @@
|
|||
<string name="user_not_found">user not found!</string>
|
||||
<string name="profile_tweets">Profile tweets</string>
|
||||
<string name="cant_send_dm">cannot send dm to user!</string>
|
||||
<string name="error_accesstoken">Invalid or expired token!</string>
|
||||
<string name="status_private">You are not authorized to see this Status!</string>
|
||||
<string name="status_too_long">Tweet needs to be shorter!</string>
|
||||
<string name="duplicate_status">Duplicate Status!</string>
|
||||
<string name="directmessage_too_long">direct message text is over the limit!</string>
|
||||
<string name="authentication_failed">failed to authenticate!</string>
|
||||
</resources>
|
Loading…
Reference in New Issue