fix some lint warnings, remove unused code

This commit is contained in:
Conny Duck 2017-11-07 15:31:44 +01:00
parent a2c361914b
commit 305d28a5c1
16 changed files with 11 additions and 86 deletions

View File

@ -58,7 +58,6 @@ import com.keylesspalace.tusky.util.ThemeUtils;
import com.pkmmte.view.CircularImageView;
import com.squareup.picasso.Picasso;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -346,14 +345,6 @@ public final class AccountActivity extends BaseActivity implements ActionButtonA
.placeholder(R.drawable.account_header_default)
.into(header);
NumberFormat nf = NumberFormat.getInstance();
// Add counts to the tabs in the TabLayout.
String[] counts = {
nf.format(Integer.parseInt(account.statusesCount)),
""
};
long followersCount = Long.parseLong(account.followersCount);
long followingCount = Long.parseLong(account.followingCount);
long statusesCount = Long.parseLong(account.statusesCount);
@ -361,16 +352,6 @@ public final class AccountActivity extends BaseActivity implements ActionButtonA
followingTextView.setText(getString(R.string.title_x_following, followingCount));
statusesTextView.setText(getString(R.string.title_x_statuses, statusesCount));
for (int i = 0; i < tabLayout.getTabCount(); i++) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
if (tab != null) {
View view = tab.getCustomView();
if (view != null) {
TextView total = view.findViewById(R.id.total);
total.setText(counts[i]);
}
}
}
}
private void onObtainAccountFailure() {

View File

@ -20,7 +20,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;

View File

@ -15,6 +15,7 @@
package com.keylesspalace.tusky;
import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
@ -45,6 +46,7 @@ import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
@SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity {
protected static final int SERVICE_REQUEST_CODE = 8574603; // This number is arbitrary.

View File

@ -109,7 +109,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;

View File

@ -15,8 +15,6 @@
package com.keylesspalace.tusky;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

View File

@ -17,10 +17,6 @@ package com.keylesspalace.tusky.entity;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Spanned;
import com.google.gson.annotations.SerializedName;
import com.keylesspalace.tusky.util.HtmlUtils;
public class Card implements Parcelable {

View File

@ -17,14 +17,10 @@ package com.keylesspalace.tusky.fragment;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@ -45,7 +41,6 @@ import com.keylesspalace.tusky.BaseActivity;
import com.keylesspalace.tusky.entity.Account;
import com.keylesspalace.tusky.entity.Relationship;
import com.keylesspalace.tusky.interfaces.AccountActionListener;
import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
import com.keylesspalace.tusky.network.MastodonApi;
import com.keylesspalace.tusky.R;
import com.keylesspalace.tusky.util.HttpHeaderLink;

View File

@ -144,7 +144,7 @@ class AccountMediaFragment : BaseFragment() {
val accountId = arguments.getString(ACCOUNT_ID_ARG)
swipeLayout = view.findViewById<SwipeRefreshLayout>(R.id.swipe_refresh_layout)
swipeLayout = view.findViewById(R.id.swipe_refresh_layout)
swipeLayout.setOnRefreshListener {
if (fetchingStatus != FetchingStatus.NOT_FETCHING) return@setOnRefreshListener
currentCall = if (statuses.isEmpty()) {

View File

@ -18,8 +18,8 @@ public class TimelineReceiver extends BroadcastReceiver {
public static final String STATUS_COMPOSED = "STATUS_COMPOSED";
}
AdapterItemRemover adapter;
SwipeRefreshLayout.OnRefreshListener refreshListener;
private AdapterItemRemover adapter;
private SwipeRefreshLayout.OnRefreshListener refreshListener;
public TimelineReceiver(AdapterItemRemover adapter) {
super();

View File

@ -47,7 +47,7 @@ import java.util.ArrayList;
import java.util.List;
public class NotificationMaker {
public static final String TAG = "NotificationMaker";
private static final String TAG = "NotificationMaker";
/** notification channels used on Android O+ **/
private static final String CHANNEL_MENTION = "CHANNEL_MENTION";

View File

@ -1,14 +1,14 @@
package com.keylesspalace.tusky.view
import android.content.Context
import android.support.v7.widget.AppCompatImageView
import android.util.AttributeSet
import android.widget.ImageView
/**
* Created by charlag on 26/10/2017.
*/
class SquareImageView : ImageView {
class SquareImageView : AppCompatImageView {
constructor(context: Context) : super(context)
constructor(context: Context, attributes: AttributeSet) : super(context, attributes)

View File

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="6dp"
android:textAllCaps="true"
android:textColor="@color/account_tab_font_color"
android:textStyle="normal|bold"
tools:text="Followers"
android:singleLine="true"
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="12sp"
app:autoSizeMaxTextSize="14sp"
app:autoSizeStepGranularity="2sp"
android:textAlignment="center"
android:ellipsize="middle"/>
<TextView
android:id="@+id/total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/account_tab_font_color"
android:textSize="12sp"
tools:text="2,412"/>
</LinearLayout>

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="pull_notification_check_interval_names">
<item>5 Minuten</item>
<item>10 Minuten</item>
<item>15 Minuten</item>
<item>20 Minuten</item>
<item>25 Minuten</item>
@ -13,8 +11,6 @@
</string-array>
<string-array name="pull_notification_check_intervals" inputType="integer">
<item>5</item>
<item>10</item>
<item>15</item>
<item>20</item>
<item>25</item>

View File

@ -22,7 +22,7 @@
<string name="title_notifications">Értesítések</string>
<string name="title_public_local">Helyi</string>
<string name="title_public_federated">Egyesített</string>
<string name="title_thread">Tülköléslánc</string>
<string name="title_view_thread">Tülköléslánc</string>
<string name="title_tag">#%s</string>
<string name="title_statuses">Posztok</string>
<string name="title_follows">Követ</string>

View File

@ -10,11 +10,6 @@
<item name="android:textColorTertiary">@color/text_color_tertiary_dark</item>
</style>
<style name="Dialog.FullScreen" parent="Theme.AppCompat.Dialog">
<item name="android:padding">0dp</item>
<item name="android:windowBackground">@android:color/black</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="colorPrimaryDark">@color/color_primary_dark_dark</item>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" />
<paths>
<external-path name="my_images" path="." />
</paths>