Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions app/src/main/java/org/fossasia/phimpme/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,4 @@ protected void attachBaseContext(Context base) {
public HandlingAlbums getAlbums() {
return albums;
}

public void setAlbums(HandlingAlbums albums) {
this.albums = albums;
}

public void updateAlbums() {
albums.loadAlbums(getApplicationContext());
}
}
20 changes: 0 additions & 20 deletions app/src/main/java/org/fossasia/phimpme/base/BasePresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,7 @@ public void attachView(T mvpView) {
mMvpView = mvpView;
}

@Override
public void detachView() {
mMvpView = null;
}

public boolean isViewAttached() {
return mMvpView != null;
}

public T getMvpView() {
return mMvpView;
}

public void checkViewAttached() {
if (!isViewAttached()) throw new MvpViewNotAttachedException();
}

public static class MvpViewNotAttachedException extends RuntimeException {
public MvpViewNotAttachedException() {
super(
"Please call Presenter.attachView(MvpView) before" + " requesting data to the Presenter");
}
}
}
2 changes: 0 additions & 2 deletions app/src/main/java/org/fossasia/phimpme/base/Presenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
public interface Presenter<V extends MvpView> {

void attachView(V mvpView);

void detachView();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public class FavouriteImagesModel extends RealmObject {

public FavouriteImagesModel() {}

public FavouriteImagesModel(String path, String description) {
this.path = path;
this.description = description;
}

public void setPath(String path) {
this.path = path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ public class TrashBinRealmModel extends RealmObject {

public TrashBinRealmModel() {}

public TrashBinRealmModel(String oldpath, String newpath, String datetime, String timeperiod) {
this.oldpath = oldpath;
this.trashbinpath = newpath;
this.datetime = datetime;
this.timeperiod = timeperiod;
}

public void setTrashbinpath(String trashbinpath) {
this.trashbinpath = trashbinpath;
}

public String getTrashbinpath() {
return trashbinpath;
}
Expand All @@ -47,8 +36,4 @@ public String getOldpath() {
public void setTimeperiod(String timeperiod) {
this.timeperiod = timeperiod;
}

public String getTimeperiod() {
return timeperiod;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ public static int getStatusBarHeight(Resources r) {
return 0;
}

public static int getNavBarHeight(Context ct) {
return getNavigationBarSize(ct).y;
}

public static Point getNavigationBarSize(Context context) {
Point appUsableSize = getAppUsableScreenSize(context);
Point realScreenSize = getRealScreenSize(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
/** Created by dnld on 01/04/16. */
public final class PermissionUtils {

public static boolean checkPermissions(Context context, String... permissions) {
for (String permission : permissions) {
if (!checkPermission(context, permission)) {
return false;
}
}
return true;
}

private static boolean checkPermission(Context context, String permission) {
return ContextCompat.checkSelfPermission(context, permission)
== PackageManager.PERMISSION_GRANTED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,6 @@ public Drawable getPlaceHolder() {
return null;
}

public static Drawable getPlaceHolder(Context context) {
switch (getBaseTheme(context)) {
case DARK_THEME:
return ContextCompat.getDrawable(context, R.drawable.ic_empty);
case AMOLED_THEME:
return ContextCompat.getDrawable(context, R.drawable.ic_empty_amoled);
case LIGHT_THEME:
return ContextCompat.getDrawable(context, R.drawable.ic_empty_white);
}
return null;
}

public int getDialogStyle() {
int style;
switch (getBaseTheme()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ protected void onPostExecute(Void aVoid) {
}
}

private class UploadToOneDrive extends AsyncTask<Void, Void, Void> {
/*private class UploadToOneDrive extends AsyncTask<Void, Void, Void> {
Boolean success;

@Override
Expand Down Expand Up @@ -783,7 +783,7 @@ protected void onPostExecute(Void aVoid) {
sendResult(FAIL);
}
}
}
}*/

@Override
public void onBackPressed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ public void execute(Realm realm) {
return list;
}

private ArrayList<TrashBinRealmModel> getTrashObjectsLast() {
ArrayList<TrashBinRealmModel> list = new ArrayList<>();
for (int i = 0; i < trashBinRealmModelRealmQuery.count(); i++) {
list.add(
trashBinRealmModelRealmQuery
.findAll()
.get((int) (trashBinRealmModelRealmQuery.count() - i - 1)));
}
return list;
}

private ArrayList<Media> loaduploaddata() {
ArrayList<Media> data = new ArrayList<>();
ArrayList<TrashBinRealmModel> binRealmModelArrayList = getTrashObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Environment;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MenuItem;
Expand All @@ -27,7 +26,6 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.fossasia.phimpme.R;
import org.fossasia.phimpme.data.local.TrashBinRealmModel;
import org.fossasia.phimpme.gallery.util.ContentHelper;
Expand Down Expand Up @@ -203,14 +201,6 @@ private boolean deletePermanent(TrashBinRealmModel trashBinRealmModel) {
return succ;
}

public void updateTrashListItems(List<TrashBinRealmModel> trashList) {
final TrashDiffCallback diffCallback = new TrashDiffCallback(this.trashItemsList, trashList);
final DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(diffCallback);
this.trashItemsList.clear();
this.trashItemsList.addAll(trashList);
diffResult.dispatchUpdatesTo(this);
}

public void setResults(ArrayList<TrashBinRealmModel> trashItemsList) {
this.trashItemsList = trashItemsList;
notifyDataSetChanged();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import android.net.Uri;
import android.support.v4.content.ContextCompat;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -22,7 +21,6 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.fossasia.phimpme.R;
import org.fossasia.phimpme.data.local.UploadHistoryRealmModel;

Expand Down Expand Up @@ -104,15 +102,6 @@ public int getItemCount() {
return realmResult.size();
}

public void updateUploadListItems(List<UploadHistoryRealmModel> uploadList) {
final UploadHisDiffCallback diffCallback =
new UploadHisDiffCallback(this.realmResult, uploadList);
final DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(diffCallback);
this.realmResult.clear();
this.realmResult.addAll(uploadList);
diffResult.dispatchUpdatesTo(this);
}

public void setResults(ArrayList<UploadHistoryRealmModel> realmResult) {
this.realmResult = realmResult;
notifyDataSetChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,7 @@ public static Snackbar show(View view, int res) {
return show(view, ActivitySwitchHelper.getContext().getResources().getString(res));
}

public static void showWithBottomMargin(View view, int res, int duration, int bottomMargin) {
showWithBottomMargin(
view,
ActivitySwitchHelper.getContext().getResources().getString(res),
bottomMargin,
duration);
}

public static Snackbar showWithBottomMargin(View view, String text, int bottomMargin) {
return showWithBottomMargin(view, text, bottomMargin, Snackbar.LENGTH_LONG);
}

public static void showWithBottomMargin(View view, int res, int bottomMargin) {
showWithBottomMargin(
view, ActivitySwitchHelper.getContext().getResources().getString(res), bottomMargin);
}
}
21 changes: 0 additions & 21 deletions app/src/main/java/org/fossasia/phimpme/utilities/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.provider.MediaStore;
import android.speech.RecognizerIntent;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.util.Base64;
import android.view.View;
import android.webkit.MimeTypeMap;
import io.realm.Realm;
import io.realm.RealmQuery;
import io.realm.RealmResults;
Expand Down Expand Up @@ -141,24 +138,6 @@ public static ArrayList<AccountDatabase.AccountName> getSharableAccountsList() {
return list;
}

public static Uri getImageUri(Context inContext, String imagePath) {
Bitmap inImage = getBitmapFromPath(imagePath);
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String path =
MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
return Uri.parse(path);
}

public static String getMimeType(String url) {
String type = null;
String extension = MimeTypeMap.getFileExtensionFromUrl(url);
if (extension != null) {
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}
return type;
}

public static boolean checkNetwork(Context context, @NonNull View view) {
if (isInternetOn(context)) {
return true;
Expand Down