mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-04 19:10:10 +03:00
Some cleaning
This commit is contained in:
parent
4a2eff9236
commit
65d0bd8f47
6 changed files with 42 additions and 49 deletions
|
@ -38,7 +38,6 @@ import java.util.List;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MainApplication extends MultiDexApplication {
|
public class MainApplication extends MultiDexApplication {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -98,16 +98,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
private Status statusReply, statusMention;
|
private Status statusReply, statusMention;
|
||||||
private StatusDraft statusDraft;
|
private StatusDraft statusDraft;
|
||||||
private ComposeAdapter composeAdapter;
|
private ComposeAdapter composeAdapter;
|
||||||
private ActivityPaginationBinding binding;
|
|
||||||
private Account account;
|
|
||||||
private String instance, token;
|
|
||||||
private Uri photoFileUri;
|
|
||||||
private ScheduledStatus scheduledStatus;
|
|
||||||
private String visibility;
|
|
||||||
private app.fedilab.android.client.entities.api.Account accountMention;
|
|
||||||
private String statusReplyId;
|
|
||||||
private app.fedilab.android.client.entities.api.Account mentionBooster;
|
|
||||||
|
|
||||||
private final BroadcastReceiver imageReceiver = new BroadcastReceiver() {
|
private final BroadcastReceiver imageReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(android.content.Context context, Intent intent) {
|
public void onReceive(android.content.Context context, Intent intent) {
|
||||||
|
@ -128,6 +118,15 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
private ActivityPaginationBinding binding;
|
||||||
|
private Account account;
|
||||||
|
private String instance, token;
|
||||||
|
private Uri photoFileUri;
|
||||||
|
private ScheduledStatus scheduledStatus;
|
||||||
|
private String visibility;
|
||||||
|
private app.fedilab.android.client.entities.api.Account accountMention;
|
||||||
|
private String statusReplyId;
|
||||||
|
private app.fedilab.android.client.entities.api.Account mentionBooster;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
|
@ -415,33 +415,6 @@ public class MastodonHelper {
|
||||||
alertDialogBoost.show();
|
alertDialogBoost.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum MediaAccountType {
|
|
||||||
AVATAR,
|
|
||||||
HEADER
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum visibility {
|
|
||||||
@SerializedName("PUBLIC")
|
|
||||||
PUBLIC("public"),
|
|
||||||
@SerializedName("UNLISTED")
|
|
||||||
UNLISTED("unlisted"),
|
|
||||||
@SerializedName("PRIVATE")
|
|
||||||
PRIVATE("private"),
|
|
||||||
@SerializedName("DIRECT")
|
|
||||||
DIRECT("direct");
|
|
||||||
|
|
||||||
private final String value;
|
|
||||||
|
|
||||||
visibility(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a single message depending of its publication date
|
* Insert a single message depending of its publication date
|
||||||
*
|
*
|
||||||
|
@ -480,6 +453,33 @@ public class MastodonHelper {
|
||||||
adapter.notifyItemRangeInserted(i, statusesToInsert.size());
|
adapter.notifyItemRangeInserted(i, statusesToInsert.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public enum MediaAccountType {
|
||||||
|
AVATAR,
|
||||||
|
HEADER
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum visibility {
|
||||||
|
@SerializedName("PUBLIC")
|
||||||
|
PUBLIC("public"),
|
||||||
|
@SerializedName("UNLISTED")
|
||||||
|
UNLISTED("unlisted"),
|
||||||
|
@SerializedName("PRIVATE")
|
||||||
|
PRIVATE("private"),
|
||||||
|
@SerializedName("DIRECT")
|
||||||
|
DIRECT("direct");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
visibility(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum ScheduleType {
|
public enum ScheduleType {
|
||||||
BOOST,
|
BOOST,
|
||||||
TIMED_MUTED
|
TIMED_MUTED
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList
|
||||||
private final FilterViewAdapter mFilterViewAdapter = new FilterViewAdapter(this);
|
private final FilterViewAdapter mFilterViewAdapter = new FilterViewAdapter(this);
|
||||||
private final ConstraintSet mConstraintSet = new ConstraintSet();
|
private final ConstraintSet mConstraintSet = new ConstraintSet();
|
||||||
PhotoEditor mPhotoEditor;
|
PhotoEditor mPhotoEditor;
|
||||||
|
String path;
|
||||||
private PropertiesBSFragment mPropertiesBSFragment;
|
private PropertiesBSFragment mPropertiesBSFragment;
|
||||||
private ShapeBSFragment mShapeBSFragment;
|
private ShapeBSFragment mShapeBSFragment;
|
||||||
private ShapeBuilder mShapeBuilder;
|
private ShapeBuilder mShapeBuilder;
|
||||||
|
@ -70,6 +71,7 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList
|
||||||
private boolean mIsFilterVisible;
|
private boolean mIsFilterVisible;
|
||||||
private Uri uri;
|
private Uri uri;
|
||||||
private boolean exit;
|
private boolean exit;
|
||||||
|
private ActivityEditImageBinding binding;
|
||||||
|
|
||||||
private static int exifToDegrees(int exifOrientation) {
|
private static int exifToDegrees(int exifOrientation) {
|
||||||
if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
|
if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
|
||||||
|
@ -82,9 +84,6 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
String path;
|
|
||||||
private ActivityEditImageBinding binding;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
|
@ -65,6 +65,8 @@ import app.fedilab.android.viewmodel.mastodon.TimelinesVM;
|
||||||
public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.FetchMoreCallBack {
|
public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.FetchMoreCallBack {
|
||||||
|
|
||||||
|
|
||||||
|
private static final int STATUS_PRESENT = -1;
|
||||||
|
private static final int STATUS_AT_THE_BOTTOM = -2;
|
||||||
private FragmentPaginationBinding binding;
|
private FragmentPaginationBinding binding;
|
||||||
private TimelinesVM timelinesVM;
|
private TimelinesVM timelinesVM;
|
||||||
private AccountsVM accountsVM;
|
private AccountsVM accountsVM;
|
||||||
|
@ -75,7 +77,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
private String max_id, min_id, min_id_fetch_more;
|
private String max_id, min_id, min_id_fetch_more;
|
||||||
private StatusAdapter statusAdapter;
|
private StatusAdapter statusAdapter;
|
||||||
private Timeline.TimeLineEnum timelineType;
|
private Timeline.TimeLineEnum timelineType;
|
||||||
private static final int STATUS_PRESENT = -1;
|
|
||||||
//Handle actions that can be done in other fragments
|
//Handle actions that can be done in other fragments
|
||||||
private final BroadcastReceiver receive_action = new BroadcastReceiver() {
|
private final BroadcastReceiver receive_action = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -137,6 +138,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
private String viewModelKey, remoteInstance;
|
private String viewModelKey, remoteInstance;
|
||||||
private String ident;
|
private String ident;
|
||||||
private String instance, user_id;
|
private String instance, user_id;
|
||||||
|
private ArrayList<String> idOfAddedStatuses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the position of the status in the ArrayList
|
* Return the position of the status in the ArrayList
|
||||||
|
@ -157,8 +159,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
return found ? position : -1;
|
return found ? position : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returned list of checked status id for reports
|
* Returned list of checked status id for reports
|
||||||
*
|
*
|
||||||
|
@ -180,15 +180,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int STATUS_AT_THE_BOTTOM = -2;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<String> idOfAddedStatuses;
|
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
ViewGroup container, Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,9 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
|
||||||
public static final int BOTTOM_TIMELINE_COUNT = 5; //home, local, public, notification, DM
|
public static final int BOTTOM_TIMELINE_COUNT = 5; //home, local, public, notification, DM
|
||||||
private final Pinned pinned;
|
private final Pinned pinned;
|
||||||
private final BottomMenu bottomMenu;
|
private final BottomMenu bottomMenu;
|
||||||
private Fragment mCurrentFragment;
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final int toRemove;
|
private final int toRemove;
|
||||||
|
private Fragment mCurrentFragment;
|
||||||
|
|
||||||
public FedilabPageAdapter(Context context, FragmentManager fm, Pinned pinned, BottomMenu bottomMenu) {
|
public FedilabPageAdapter(Context context, FragmentManager fm, Pinned pinned, BottomMenu bottomMenu) {
|
||||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||||
|
|
Loading…
Reference in a new issue