Some cleaning
This commit is contained in:
parent
35b5bd770e
commit
bff106561b
|
@ -18,6 +18,7 @@ import android.content.Context;
|
|||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.widget.DividerItemDecoration;
|
||||
|
@ -62,7 +63,7 @@ public class DisplayFollowRequestSentFragment extends Fragment implements OnRetr
|
|||
private boolean swiped;
|
||||
private RecyclerView lv_accounts;
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
//View for fragment is the same that fragment accounts
|
||||
View rootView = inflater.inflate(R.layout.fragment_accounts, container, false);
|
||||
|
|
|
@ -48,9 +48,6 @@ import fr.gouv.etalab.mastodon.client.APIResponse;
|
|||
import fr.gouv.etalab.mastodon.drawers.ListAdapter;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.interfaces.OnListActionInterface;
|
||||
import fr.gouv.etalab.mastodon.sqlite.SearchDAO;
|
||||
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -65,8 +62,6 @@ public class DisplayListsFragment extends Fragment implements OnListActionInterf
|
|||
private List<fr.gouv.etalab.mastodon.client.Entities.List> lists;
|
||||
private TextView no_action_text;
|
||||
private RelativeLayout mainLoader;
|
||||
private ListView lv_lists;
|
||||
private RelativeLayout textviewNoAction;
|
||||
private FloatingActionButton add_new;
|
||||
private ListAdapter listAdapter;
|
||||
|
||||
|
@ -80,8 +75,8 @@ public class DisplayListsFragment extends Fragment implements OnListActionInterf
|
|||
lists = new ArrayList<>();
|
||||
|
||||
|
||||
lv_lists = rootView.findViewById(R.id.lv_lists);
|
||||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
ListView lv_lists = rootView.findViewById(R.id.lv_lists);
|
||||
RelativeLayout textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
no_action_text = rootView.findViewById(R.id.no_action_text);
|
||||
mainLoader = rootView.findViewById(R.id.loader);
|
||||
RelativeLayout nextElementLoader = rootView.findViewById(R.id.loading_next_items);
|
||||
|
|
|
@ -26,6 +26,7 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -60,7 +61,7 @@ public class DisplayScheduledTootsFragment extends Fragment implements OnRetriev
|
|||
private TextView warning_battery_message;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View rootView = inflater.inflate(R.layout.fragment_scheduled_toots, container, false);
|
||||
context = getContext();
|
||||
|
|
|
@ -16,6 +16,7 @@ package fr.gouv.etalab.mastodon.fragments;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -38,10 +39,11 @@ public class SettingsOptimizationFragment extends Fragment {
|
|||
private Context context;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View rootView = inflater.inflate(R.layout.fragment_settings_optimization, container, false);
|
||||
context = getContext();
|
||||
assert context != null;
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ExpandableHeightListView extends ListView
|
|||
}
|
||||
}
|
||||
|
||||
public void setExpanded(boolean expanded)
|
||||
public void setExpanded(@SuppressWarnings("SameParameterValue") boolean expanded)
|
||||
{
|
||||
this.expanded = expanded;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ package fr.gouv.etalab.mastodon.jobs;
|
|||
*
|
||||
* 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.support.annotation.NonNull;
|
||||
|
||||
import com.evernote.android.job.Job;
|
||||
import com.evernote.android.job.JobCreator;
|
||||
import com.evernote.android.job.JobManager;
|
||||
|
@ -24,7 +26,7 @@ import com.evernote.android.job.JobManager;
|
|||
|
||||
public class ApplicationJob implements JobCreator {
|
||||
@Override
|
||||
public Job create(String tag) {
|
||||
public Job create(@NonNull String tag) {
|
||||
switch (tag) {
|
||||
case NotificationsSyncJob.NOTIFICATION_REFRESH:
|
||||
return new NotificationsSyncJob();
|
||||
|
|
|
@ -35,10 +35,6 @@ import com.evernote.android.job.Job;
|
|||
import com.evernote.android.job.JobManager;
|
||||
import com.evernote.android.job.JobRequest;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
|
@ -35,10 +35,6 @@ import com.evernote.android.job.Job;
|
|||
import com.evernote.android.job.JobManager;
|
||||
import com.evernote.android.job.JobRequest;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ScheduledTootsSyncJob extends Job {
|
|||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Result onRunJob(Params params) {
|
||||
protected Result onRunJob(@NonNull Params params) {
|
||||
//Code refresh here
|
||||
int jobId = params.getId();
|
||||
SQLiteDatabase db = Sqlite.getInstance(getContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
package fr.gouv.etalab.mastodon.services;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.IntentService;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
|
||||
import java.security.Security;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 13/12/2017.
|
||||
* BaseService class to install provider
|
||||
*/
|
||||
|
||||
@SuppressLint("Registered")
|
||||
public class BaseService extends IntentService {
|
||||
|
||||
static {
|
||||
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 2);
|
||||
Security.addProvider(Conscrypt.newProvider());
|
||||
|
||||
Helper.installProvider();
|
||||
}
|
||||
|
||||
public BaseService(String name) {
|
||||
|
|
|
@ -13,7 +13,7 @@ package fr.gouv.etalab.mastodon.services;
|
|||
*
|
||||
* 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.app.IntentService;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
Loading…
Reference in New Issue