Refactor: Organize Java classes in packages
This commit is contained in:
parent
e5128b9ccb
commit
76133f4131
25 changed files with 67 additions and 35 deletions
|
@ -31,6 +31,10 @@ import org.apache.commons.codec.binary.Base32;
|
|||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
import org.shadowice.flocke.andotp.Utilities.DatabaseHelper;
|
||||
import org.shadowice.flocke.andotp.Utilities.EncryptionHelper;
|
||||
import org.shadowice.flocke.andotp.Utilities.TokenCalculator;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -51,7 +55,7 @@ import javax.crypto.NoSuchPaddingException;
|
|||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import static org.shadowice.flocke.andotp.TokenCalculator.TOTP_DEFAULT_PERIOD;
|
||||
import static org.shadowice.flocke.andotp.Utilities.TokenCalculator.TOTP_DEFAULT_PERIOD;
|
||||
|
||||
public class ApplicationTest extends ApplicationTestCase<Application> {
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:name=".MyApplication"
|
||||
>
|
||||
android:name=".MyApplication" >
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:name=".Activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
|
@ -24,16 +24,16 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".AboutActivity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:name=".Activities.AboutActivity"
|
||||
android:parentActivityName=".Activities.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".BackupActivity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:name=".Activities.BackupActivity"
|
||||
android:parentActivityName=".Activities.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:name=".Activities.SettingsActivity"
|
||||
android:parentActivityName=".Activities.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
|
@ -35,6 +35,9 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.shadowice.flocke.andotp.Utilities.ThemeHelper;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
import de.psdev.licensesdialog.LicensesDialog;
|
||||
|
||||
public class AboutActivity extends BaseActivity {
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Activities;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -49,6 +49,12 @@ import org.openintents.openpgp.OpenPgpError;
|
|||
import org.openintents.openpgp.OpenPgpSignatureResult;
|
||||
import org.openintents.openpgp.util.OpenPgpApi;
|
||||
import org.openintents.openpgp.util.OpenPgpServiceConnection;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
import org.shadowice.flocke.andotp.Utilities.FileHelper;
|
||||
import org.shadowice.flocke.andotp.Utilities.DatabaseHelper;
|
||||
import org.shadowice.flocke.andotp.Utilities.EncryptionHelper;
|
||||
import org.shadowice.flocke.andotp.Utilities.StorageHelper;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
|
@ -1,10 +1,12 @@
|
|||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Activities;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
|
@ -21,7 +21,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Activities;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -55,7 +55,12 @@ import android.widget.Toast;
|
|||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
|
||||
import org.shadowice.flocke.andotp.ItemTouchHelper.SimpleItemTouchHelperCallback;
|
||||
import org.shadowice.flocke.andotp.View.EntriesCardAdapter;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
import org.shadowice.flocke.andotp.View.FloatingActionMenu;
|
||||
import org.shadowice.flocke.andotp.View.ItemTouchHelper.SimpleItemTouchHelperCallback;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
import org.shadowice.flocke.andotp.Utilities.TokenCalculator;
|
||||
|
||||
public class MainActivity extends BaseActivity
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener {
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Activities;
|
||||
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.Intent;
|
||||
|
@ -34,6 +34,7 @@ import android.view.ViewStub;
|
|||
|
||||
import org.openintents.openpgp.util.OpenPgpAppPreference;
|
||||
import org.openintents.openpgp.util.OpenPgpKeyPreference;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
public class SettingsActivity extends BaseActivity
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|
@ -21,13 +21,14 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Database;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
import org.apache.commons.codec.binary.Base32;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.shadowice.flocke.andotp.Utilities.TokenCalculator;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
|
@ -25,6 +25,8 @@ package org.shadowice.flocke.andotp;
|
|||
|
||||
import android.app.Application;
|
||||
|
||||
import org.shadowice.flocke.andotp.Utilities.PRNGFixes;
|
||||
|
||||
public class MyApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
|
|
@ -21,12 +21,13 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
|
@ -21,7 +21,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
|
@ -1,4 +1,4 @@
|
|||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
/*
|
||||
* This software is provided 'as-is', without any express or implied
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.os.Environment;
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
|
@ -21,7 +21,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.InvalidKeyException;
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.View;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ClipData;
|
||||
|
@ -42,7 +42,10 @@ import android.widget.Filterable;
|
|||
import android.widget.FrameLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.shadowice.flocke.andotp.ItemTouchHelper.ItemTouchHelperAdapter;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
import org.shadowice.flocke.andotp.Utilities.DatabaseHelper;
|
||||
import org.shadowice.flocke.andotp.View.ItemTouchHelper.ItemTouchHelperAdapter;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
|
@ -1,4 +1,4 @@
|
|||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.View;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.ColorFilter;
|
||||
|
@ -11,7 +11,9 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.shadowice.flocke.andotp.ItemTouchHelper.ItemTouchHelperViewHolder;
|
||||
import org.shadowice.flocke.andotp.Utilities.ThemeHelper;
|
||||
import org.shadowice.flocke.andotp.View.ItemTouchHelper.ItemTouchHelperViewHolder;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
public class EntryViewHolder extends RecyclerView.ViewHolder
|
||||
implements ItemTouchHelperViewHolder {
|
|
@ -20,7 +20,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp;
|
||||
package org.shadowice.flocke.andotp.View;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.constraint.ConstraintLayout;
|
||||
|
@ -32,6 +32,8 @@ import android.view.animation.AnimationUtils;
|
|||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
||||
public class FloatingActionMenu {
|
||||
private boolean isFabMenuOpen = false;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp.ItemTouchHelper;
|
||||
package org.shadowice.flocke.andotp.View.ItemTouchHelper;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.helper.ItemTouchHelper;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp.ItemTouchHelper;
|
||||
package org.shadowice.flocke.andotp.View.ItemTouchHelper;
|
||||
|
||||
import android.support.v7.widget.helper.ItemTouchHelper;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.shadowice.flocke.andotp.ItemTouchHelper;
|
||||
package org.shadowice.flocke.andotp.View.ItemTouchHelper;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="org.shadowice.flocke.andotp.MainActivity">
|
||||
tools:context="org.shadowice.flocke.andotp.Activities.MainActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="org.shadowice.flocke.andotp.MainActivity"
|
||||
tools:context="org.shadowice.flocke.andotp.Activities.MainActivity"
|
||||
tools:showIn="@layout/activity_main">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
|
|
Loading…
Reference in a new issue