Commit 6e517f7f authored by Amit Kumar's avatar Amit Kumar
Browse files

Modularize app base code

parent 7ccad36f
......@@ -14,7 +14,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".DesktopActivity"
android:name=".ui.DesktopActivity"
android:clearTaskOnLaunch="true"
android:launchMode="singleTask"
android:screenOrientation="nosensor"
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.db;
import android.content.Context;
import android.content.SharedPreferences;
......@@ -6,13 +6,12 @@ import android.os.AsyncTask;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.GridLayout;
import android.widget.LinearLayout;
import org.indin.blisslaunchero.model.AppItem;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.security.acl.Group;
import java.util.List;
public class Storage {
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.model;
import android.content.Intent;
import android.graphics.drawable.Drawable;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.ui;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
......@@ -21,7 +21,6 @@ import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.DragEvent;
import android.view.Gravity;
......@@ -43,12 +42,23 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.indin.blisslaunchero.R;
import org.indin.blisslaunchero.db.Storage;
import org.indin.blisslaunchero.model.AppItem;
import org.indin.blisslaunchero.utils.AppUtil;
import org.indin.blisslaunchero.utils.GraphicsUtil;
import org.indin.blisslaunchero.utils.IconPackUtil;
import org.indin.blisslaunchero.utils.ConverterUtil;
import org.indin.blisslaunchero.widgets.BlissDragShadowBuilder;
import org.indin.blisslaunchero.widgets.BlissInput;
import org.indin.blisslaunchero.widgets.CustomAnalogClock;
import org.indin.blisslaunchero.widgets.HorizontalPager;
import org.indin.blisslaunchero.widgets.SquareImageView;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.UUID;
......@@ -492,7 +502,7 @@ public class DesktopActivity extends AppCompatActivity {
// reappear when user swipes to the first apps page
if (currentPageNumber == 0) {
dock.animate().translationYBy(
Utils.dp2Px(105, DesktopActivity.this)).setDuration(
ConverterUtil.dp2Px(105, DesktopActivity.this)).setDuration(
100).withEndAction(new Runnable() {
@Override
public void run() {
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.utils;
import android.app.ActivityOptions;
import android.content.Context;
......@@ -12,6 +12,9 @@ import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.Nullable;
import org.indin.blisslaunchero.model.AppItem;
import org.indin.blisslaunchero.R;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.utils;
/**
* Created by falcon on 8/3/18.
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.utils;
import android.content.Context;
import android.util.DisplayMetrics;
public class Utils {
public class ConverterUtil {
public static float dp2Px(int dp, Context context){
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
return dp * (metrics.densityDpi / 160f);
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.utils;
import android.content.Context;
import android.graphics.Bitmap;
......@@ -15,6 +15,9 @@ import android.renderscript.ScriptIntrinsicBlur;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import org.indin.blisslaunchero.model.AppItem;
import org.indin.blisslaunchero.R;
public class GraphicsUtil {
private static final String TAG = "BLISS_GRAPHICS";
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.utils;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.DisplayMetrics;
import android.util.Log;
import org.indin.blisslaunchero.R;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.graphics.Canvas;
import android.graphics.Point;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.util.AttributeSet;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.content.res.Resources;
......@@ -8,9 +8,11 @@ import android.os.Handler;
import android.support.annotation.DrawableRes;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import org.indin.blisslaunchero.ui.DesktopActivity;
import org.indin.blisslaunchero.R;
import java.util.ArrayList;
import java.util.Calendar;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import java.util.Calendar;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.content.res.Resources;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
/**
* Created by falcon on 11/2/18.
......@@ -20,6 +20,8 @@ import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.Scroller;
import org.indin.blisslaunchero.R;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.support.annotation.NonNull;
......
package org.indin.blisslaunchero;
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.support.annotation.Nullable;
......
......@@ -6,9 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="org.indin.blisslaunchero.DesktopActivity">
tools:context="org.indin.blisslaunchero.ui.DesktopActivity">
<org.indin.blisslaunchero.HorizontalPager
<org.indin.blisslaunchero.widgets.HorizontalPager
android:id="@+id/pages_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -51,7 +51,7 @@
android:background="#E6000000"
android:visibility="gone">
<org.indin.blisslaunchero.BlissInput
<org.indin.blisslaunchero.widgets.BlissInput
android:id="@+id/folder_title"
android:layout_width="250dp"
android:layout_height="wrap_content"
......
......@@ -10,13 +10,13 @@
android:gravity="center"
android:orientation="vertical">
<org.indin.blisslaunchero.SquareFrameLayout
<org.indin.blisslaunchero.widgets.SquareFrameLayout
android:id="@+id/app_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<org.indin.blisslaunchero.SquareImageView
<org.indin.blisslaunchero.widgets.SquareImageView
android:id="@+id/icon_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -25,13 +25,13 @@
android:foreground="?attr/selectableItemBackground"
android:scaleType="fitCenter" />
<org.indin.blisslaunchero.CustomAnalogClock
<org.indin.blisslaunchero.widgets.CustomAnalogClock
android:id="@+id/icon_clock"
android:visibility="gone"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</org.indin.blisslaunchero.SquareFrameLayout>
</org.indin.blisslaunchero.widgets.SquareFrameLayout>
<TextView
android:id="@+id/app_label"
......
......@@ -19,7 +19,7 @@
android:src="@drawable/ic_search_black_24dp"
android:tint="#888888"
android:layout_marginLeft="5dp"/>
<org.indin.blisslaunchero.BlissInput
<org.indin.blisslaunchero.widgets.BlissInput
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment