Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
missing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
velitasali committed Jan 22, 2018
1 parent bb2d89a commit 8b78d82
Show file tree
Hide file tree
Showing 41 changed files with 88 additions and 93 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.genonbeta.TrebleShot"
minSdkVersion 14
targetSdkVersion 26
versionCode 56
versionName "1.2.5.1"
versionCode 57
versionName "1.2.5.2"
}

lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.PersistableBundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
Expand All @@ -25,7 +22,6 @@
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
Expand Down Expand Up @@ -152,8 +148,7 @@ public void onInfoAvailable(boolean newVersion, String versionName, String title
.putInt("migrated_version", localDevice.versionNumber)
.apply();

if (!checkCurrentRequestedFragment(getIntent()))
{
if (!checkCurrentRequestedFragment(getIntent())) {
changeFragment(mFragmentDeviceList);
mNavigationView.setCheckedItem(R.id.menu_activity_main_device_list);
}
Expand Down Expand Up @@ -302,8 +297,7 @@ public void run()
if (!mIsStopped) {
ft.commit();
mCommitFailedFragment = null;
}
else
} else
mCommitFailedFragment = fragment;

setTitle(fragment instanceof TitleSupport
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package com.genonbeta.TrebleShot.activity;

import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.support.v7.app.AlertDialog;
import android.view.Menu;
import android.view.MenuItem;

import com.genonbeta.TrebleShot.R;
import com.genonbeta.TrebleShot.app.Activity;
import com.genonbeta.TrebleShot.fragment.PreferencesFragment;
import com.genonbeta.TrebleShot.util.AppUtils;

public class PreferencesActivity extends Activity
{
Expand All @@ -23,11 +31,41 @@ public boolean onOptionsItemSelected(MenuItem item)
{
int id = item.getItemId();

if (id == android.R.id.home) {
if (id == android.R.id.home)
finish();
return true;
}
else if (id == R.id.actions_preference_main_reset_to_defaults) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);

return super.onOptionsItemSelected(item);
builder.setTitle(R.string.ques_resetToDefault);
builder.setMessage(R.string.text_resetPreferencesToDefaultSummary);
builder.setNegativeButton(R.string.butn_cancel, null);
builder.setPositiveButton(R.string.butn_proceed, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

sharedPreferences.edit()
.clear()
.apply();

PreferenceManager.setDefaultValues(PreferencesActivity.this, R.xml.preferences_main, true);
finish();
}
});

builder.show();
} else
return super.onOptionsItemSelected(item);

return true;
}

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.actions_preferences_main, menu);
return super.onCreateOptionsMenu(menu);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
import com.genonbeta.TrebleShot.service.CommunicationService;
import com.genonbeta.TrebleShot.util.AppUtils;
import com.genonbeta.TrebleShot.util.FileUtils;
import com.genonbeta.TrebleShot.util.NetworkUtils;
import com.genonbeta.TrebleShot.util.PowerfulActionModeSupported;
import com.genonbeta.TrebleShot.util.TextUtils;
import com.genonbeta.TrebleShot.util.TimeUtils;
import com.genonbeta.TrebleShot.widget.PowerfulActionMode;
import com.genonbeta.android.database.SQLQuery;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class ApplicationListAdapter
extends ShareableListAdapter<ApplicationListAdapter.PackageHolder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand All @@ -20,7 +19,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class FileListAdapter extends ShareableListAdapter<FileListAdapter.FileHolder>
{
Expand Down Expand Up @@ -84,8 +82,7 @@ else if (Build.VERSION.SDK_INT >= 19)
if (splitPath.length >= 2
&& splitPath[1].equals("storage")
&& splitPath[splitPath.length - 1].equals(getContext().getPackageName())) {
if (splitPath.length >= 4 && splitPath[2].equals("emulated"))
{
if (splitPath.length >= 4 && splitPath[2].equals("emulated")) {
File file = new File(buildPath(splitPath, 4));

if (file.canWrite()) {
Expand Down Expand Up @@ -123,8 +120,7 @@ public String buildPath(String[] splitPath, int count)
{
StringBuilder stringBuilder = new StringBuilder();

for (int i = 0; (i < count && i < splitPath.length); i ++)
{
for (int i = 0; (i < count && i < splitPath.length); i++) {
stringBuilder.append(File.separator);
stringBuilder.append(splitPath[i]);
}
Expand Down Expand Up @@ -194,7 +190,7 @@ public void onClick(View v)
});
}

image.setImageResource(holder.isFolder ? R.drawable.ic_folder_white_24dp: R.drawable.ic_whatshot_white_24dp);
image.setImageResource(holder.isFolder ? R.drawable.ic_folder_white_24dp : R.drawable.ic_whatshot_white_24dp);
text1.setText(holder.friendlyName);
text2.setText(holder.fileInfo);
text3.setText(TimeUtils.getTimeAgo(getContext(), holder.file.lastModified()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.util.ArrayMap;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -22,7 +21,6 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class MusicListAdapter
extends ShareableListAdapter<MusicListAdapter.SongHolder>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.genonbeta.TrebleShot.adapter;

import android.content.Context;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand All @@ -17,7 +14,6 @@
import com.genonbeta.TrebleShot.database.AccessDatabase;
import com.genonbeta.TrebleShot.fragment.NetworkDeviceListFragment;
import com.genonbeta.TrebleShot.object.NetworkDevice;
import com.genonbeta.TrebleShot.util.HotspotUtils;
import com.genonbeta.TrebleShot.util.TextUtils;
import com.genonbeta.TrebleShot.widget.ListAdapter;
import com.genonbeta.android.database.SQLQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
import com.genonbeta.TrebleShot.object.TextStreamObject;
import com.genonbeta.TrebleShot.util.TimeUtils;
import com.genonbeta.TrebleShot.widget.EditableListAdapter;
import com.genonbeta.TrebleShot.widget.ShareableListAdapter;
import com.genonbeta.android.database.SQLQuery;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

/**
* created by: Veli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand Down Expand Up @@ -170,7 +169,7 @@ public TransactionGroupListAdapter setSelect(SQLQuery.Select select)

public static class PreloadedGroup
extends TransactionObject.Group
implements Editable
implements Editable
{
public int transactionCount;
public String deviceName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.genonbeta.TrebleShot.util.FileUtils;
import com.genonbeta.TrebleShot.util.TextUtils;
import com.genonbeta.TrebleShot.widget.EditableListAdapter;
import com.genonbeta.TrebleShot.widget.ShareableListAdapter;
import com.genonbeta.android.database.SQLQuery;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

/**
* created by: Veli
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/genonbeta/TrebleShot/app/Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

import com.genonbeta.TrebleShot.R;
import com.genonbeta.TrebleShot.activity.HomeActivity;
import com.genonbeta.TrebleShot.dialog.RationalePermissionRequest;
import com.genonbeta.TrebleShot.service.CommunicationService;
import com.genonbeta.TrebleShot.util.AppUtils;
Expand All @@ -24,6 +22,8 @@ protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

PreferenceManager.setDefaultValues(this, R.xml.preferences_main, false);

if (Build.VERSION.SDK_INT >= 16) {
RationalePermissionRequest storagePermission = new RationalePermissionRequest(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.FileProvider;
import android.support.v7.widget.SearchView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand All @@ -19,15 +16,13 @@
import com.genonbeta.TrebleShot.R;
import com.genonbeta.TrebleShot.activity.ShareActivity;
import com.genonbeta.TrebleShot.io.StreamInfo;
import com.genonbeta.TrebleShot.object.Selectable;
import com.genonbeta.TrebleShot.object.Shareable;
import com.genonbeta.TrebleShot.util.FileUtils;
import com.genonbeta.TrebleShot.widget.PowerfulActionMode;
import com.genonbeta.TrebleShot.widget.ShareableListAdapter;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;

public abstract class ShareableListFragment<T extends Shareable, E extends ShareableListAdapter<T>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import android.os.Looper;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.SwitchCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.Toast;

import com.genonbeta.CoolSocket.CoolSocket;
import com.genonbeta.TrebleShot.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v7.widget.AppCompatImageButton;
Expand All @@ -20,7 +19,6 @@
import com.genonbeta.TrebleShot.adapter.PathResolverRecyclerAdapter;
import com.genonbeta.TrebleShot.dialog.CreateFolderDialog;
import com.genonbeta.TrebleShot.util.DetachListener;
import com.genonbeta.TrebleShot.util.FABSupport;
import com.genonbeta.TrebleShot.util.TitleSupport;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.Snackbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -18,7 +17,6 @@
import com.genonbeta.TrebleShot.adapter.FileListAdapter;
import com.genonbeta.TrebleShot.app.ShareableListFragment;
import com.genonbeta.TrebleShot.dialog.FileDeleteDialog;
import com.genonbeta.TrebleShot.util.AppUtils;
import com.genonbeta.TrebleShot.util.FileUtils;
import com.genonbeta.TrebleShot.widget.PowerfulActionMode;

Expand Down
Loading

0 comments on commit 8b78d82

Please sign in to comment.