code cleanup

This commit is contained in:
nuclearfog 2023-01-28 19:58:22 +01:00
parent 8982537907
commit 99feb3ee9c
No known key found for this signature in database
GPG Key ID: 03488A185C476379
10 changed files with 10 additions and 13 deletions

View File

@ -137,7 +137,7 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
/**
* setup adapter for viewing user timeline and favorites
*
* @param userId ID of the user
* @param userId ID of the user
* @param account true to enable favorite page
*/
public void setupProfilePage(long userId, Account account) {

View File

@ -105,7 +105,7 @@ public class AccountHolder extends ViewHolder implements OnClickListener {
screenname.setText(R.string.account_user_id_prefix);
screenname.append(Long.toString(account.getId()));
}
switch(account.getConfiguration()) {
switch (account.getConfiguration()) {
case TWITTER1:
case TWITTER2:
screenname.append(ACCOUNT_TWITTER);

View File

@ -63,7 +63,7 @@ public class ConnectionManager {
GlobalSettings settings = GlobalSettings.getInstance(context);
// select automatically
if (select == SELECT_AUTO) {
switch(settings.getLogin().getConfiguration()) {
switch (settings.getLogin().getConfiguration()) {
case TWITTER1:
connection = new TwitterV1(context);
break;
@ -80,7 +80,7 @@ public class ConnectionManager {
throw new RuntimeException("no connection selected!");
}
} else {
switch(select) {
switch (select) {
case SELECT_TWITTER_1:
connection = new TwitterV1(context);
break;

View File

@ -8,8 +8,8 @@ import org.nuclearfog.twidda.backend.api.Connection;
import org.nuclearfog.twidda.backend.api.ConnectionException;
import org.nuclearfog.twidda.backend.api.ConnectionManager;
import org.nuclearfog.twidda.backend.update.ConnectionConfig;
import org.nuclearfog.twidda.database.AppDatabase;
import org.nuclearfog.twidda.config.GlobalSettings;
import org.nuclearfog.twidda.database.AppDatabase;
import org.nuclearfog.twidda.model.Account;
import org.nuclearfog.twidda.ui.activities.LoginActivity;

View File

@ -66,6 +66,7 @@ public class ConnectionConfig {
/**
* get configured API type
*
* @return API type {@link #API_MASTODON,#API_TWITTER_1,#API_TWITTER_2}
*/
public int getApiType() {

View File

@ -505,7 +505,7 @@ public class GlobalSettings {
* @return saved location information
*/
public Location getTrendLocation() {
switch(account.getConfiguration()) {
switch (account.getConfiguration()) {
case TWITTER1:
case TWITTER2:
return location;

View File

@ -245,7 +245,7 @@ public class LoginActivity extends AppCompatActivity implements OnClickListener,
loginLink = null;
if (id == NetworkAdapter.ID_TWITTER) {
connection.setApiType(ConnectionConfig.API_TWITTER_2);
} else if (id == NetworkAdapter.ID_MASTODON) {
} else if (id == NetworkAdapter.ID_MASTODON) {
connection.setApiType(ConnectionConfig.API_MASTODON);
}
}
@ -267,7 +267,7 @@ public class LoginActivity extends AppCompatActivity implements OnClickListener,
break;
case LoginAction.MODE_REQUEST_MASTODON:
case LoginAction.MODE_REQUEST_TWITTER:
case LoginAction.MODE_REQUEST_TWITTER:
loginLink = result;
connect();
break;

View File

@ -47,8 +47,8 @@ import org.nuclearfog.twidda.backend.api.ConnectionException;
import org.nuclearfog.twidda.backend.async.LocationLoader;
import org.nuclearfog.twidda.backend.utils.AppStyles;
import org.nuclearfog.twidda.backend.utils.ErrorHandler;
import org.nuclearfog.twidda.database.DatabaseAdapter;
import org.nuclearfog.twidda.config.GlobalSettings;
import org.nuclearfog.twidda.database.DatabaseAdapter;
import org.nuclearfog.twidda.model.Location;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;

View File

@ -248,8 +248,6 @@
<string name="info_login_to_mastodon">in Mastodon einloggen</string>
<string name="error_service_unavailable">Service zur Zeit nicht verfügbar!</string>
<string name="popup_tweet_hint">Status</string>
<string name="error_invalid_url">Url ungültig!</string>
<string name="error_empty_token">Bitte Schlüssel hinzufügen</string>
<string name="info_account_selected">%1$s ausgewählt</string>
<string name="menu_message">Nachricht schreiben</string>
<string name="status_replyname_empty">Antwort</string>

View File

@ -108,9 +108,7 @@
<string name="error_forbidden_api_access">API does not support this operation!</string>
<string name="error_adding_media">Error occurred while adding media!</string>
<string name="error_media_init">Error while preparing media files for upload!</string>
<string name="error_empty_token">please add token key</string>
<string name="error_empty_text">Empty text!</string>
<string name="error_invalid_url">invalid URL!</string>
<!-- menu icon strings -->
<string name="menu_tweet">write status</string>