layout fix, added error message, added license

Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
nuclearfog 2021-10-27 19:30:00 +02:00
parent d22bb28657
commit 5027ba6add
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
7 changed files with 34 additions and 2 deletions

View File

@ -1,10 +1,10 @@
package org.nuclearfog.twidda.backend.engine;
import twitter4j.TwitterException;
import static org.nuclearfog.twidda.backend.engine.EngineException.ErrorType.RESOURCE_NOT_FOUND;
import static org.nuclearfog.twidda.backend.engine.EngineException.ErrorType.USER_NOT_FOUND;
import twitter4j.TwitterException;
/**
* Exception class for {@link TwitterEngine}
*
@ -30,6 +30,7 @@ public class EngineException extends Exception {
NO_LINK_DEFINED,
NO_CONNECTION,
IMAGE_NOT_LOADED,
REQUEST_CANCELLED,
ACCOUNT_UPDATE_FAILED,
ERROR_API_ACCESS_DENIED,
ERROR_NOT_DEFINED
@ -128,6 +129,8 @@ public class EngineException extends Exception {
default:
if (error.getStatusCode() == 401) {
errorType = ErrorType.NOT_AUTHORIZED;
} else if (error.getStatusCode() == 408) {
errorType = ErrorType.REQUEST_CANCELLED;
} else if (error.isCausedByNetworkIssue()) {
errorType = ErrorType.NO_CONNECTION;
} else {

View File

@ -100,6 +100,9 @@ public final class ErrorHandler {
case ACCOUNT_UPDATE_FAILED:
return context.getString(R.string.error_acc_update);
case REQUEST_CANCELLED:
return context.getString(R.string.error_result_cancelled);
case APP_SUSPENDED:
case ERROR_API_ACCESS_DENIED:
GlobalSettings settings = GlobalSettings.getInstance(context);

View File

@ -27,6 +27,8 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/confirm_text_margin"
android:textSize="@dimen/confirm_message_fontsize"
android:maxLines="@integer/confirm_message_max_ines"
android:scrollbars="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/confirm_title"
app:layout_constraintBottom_toTopOf="@id/confirm_barrier"

View File

@ -216,4 +216,5 @@
<string name="info_permission_write">Schreibrechte werden benötigt um Bilder zu speichern.</string>
<string name="info_permission_read">Leserechte werden benötigt um Bilder und Videos einzufügen.</string>
<string name="info_permission_location">Standortinformationen werden ausschließlich für Tweets verwendet.</string>
<string name="error_result_cancelled">Fehler, Anfrage wurde abgebrochen!</string>
</resources>

View File

@ -195,6 +195,7 @@
<dimen name="confirm_button_fontsize">14sp</dimen>
<dimen name="confirm_message_fontsize">18sp</dimen>
<dimen name="confirm_title_fontsize">22sp</dimen>
<integer name="confirm_message_max_ines">8</integer>
<!--dimens of dialog_userlist.xml-->
<dimen name="userlist_button_height">20dp</dimen>

View File

@ -198,6 +198,7 @@
<string name="error_api_access_denied">Error, API access denied! Please check your API Keys.</string>
<string name="error_api_key_expired">Error, API Keys expired! Please update app!</string>
<string name="error_mention_exceed">Too much mentions!</string>
<string name="error_result_cancelled">Error, result cancelled!</string>
<string name="error_twitter_search">Error, search query is too long or contains illegal characters!</string>
<string name="error_not_defined">Not specified error!</string>

View File

@ -1,5 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<licenses>
<license
name="Shitter, ZoomView, Tagger, LinkAndScrollMovement"
type="library">
Copyright 2018 nuclearfog
Licensed under the Apache License,
Version 2.0 (the "License");
you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law
or agreed to in writing,
software Distributed under the License
is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied.
See the License for the specific
language governing permissions and
limitations under the License.
</license>
<license
name="Twitter4J"
type="library">