mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Rename MaterialActivity to MainActivity
Summary: Its more descriptive Reviewers: #kde_connect, mtijink Reviewed By: #kde_connect, mtijink Subscribers: mtijink, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D10951
This commit is contained in:
parent
889251ed94
commit
e72e0f61dd
@ -63,7 +63,7 @@
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.UserInterface.MaterialActivity"
|
||||
android:name="org.kde.kdeconnect.UserInterface.MainActivity"
|
||||
android:label="KDE Connect"
|
||||
android:theme="@style/KdeConnectTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
@ -75,26 +75,26 @@
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.UserInterface.SettingsActivity"
|
||||
android:label="@string/device_menu_plugins"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity">
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.UserInterface.CustomDevicesActivity"
|
||||
android:label="@string/custom_devices_settings"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity">
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.Plugins.SharePlugin.SendFileActivity"
|
||||
android:label="KDE Connect"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity">
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.UserInterface.PluginSettingsActivity"
|
||||
@ -146,10 +146,10 @@
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity"
|
||||
android:label="@string/remote_control"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity">
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<receiver android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisMediaNotificationReceiver">
|
||||
<intent-filter>
|
||||
@ -160,20 +160,20 @@
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandActivity"
|
||||
android:label="@string/remote_control"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity">
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.Plugins.MousePadPlugin.MousePadActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:label="@string/remote_control"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MaterialActivity"
|
||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.kde.kdeconnect.UserInterface.MaterialActivity" />
|
||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity"
|
||||
|
@ -7,4 +7,4 @@
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="16dip"
|
||||
tools:context="org.kde.kdeconnect.UserInterface.MaterialActivity"></ListView>
|
||||
tools:context="org.kde.kdeconnect.UserInterface.MainActivity"></ListView>
|
||||
|
@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="org.kde.kdeconnect.UserInterface.MaterialActivity"> <!-- fitSystemWindows to make the drawer slide below the Lollipop transparent status bar -->
|
||||
tools:context="org.kde.kdeconnect.UserInterface.MainActivity"> <!-- fitSystemWindows to make the drawer slide below the Lollipop transparent status bar -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -42,7 +42,7 @@ import org.kde.kdeconnect.Helpers.NotificationHelper;
|
||||
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.Plugins.PluginFactory;
|
||||
import org.kde.kdeconnect.UserInterface.MaterialActivity;
|
||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
import java.security.KeyFactory;
|
||||
@ -374,23 +374,23 @@ public class Device implements BaseLink.PackageReceiver {
|
||||
|
||||
notificationId = (int) System.currentTimeMillis();
|
||||
|
||||
Intent intent = new Intent(getContext(), MaterialActivity.class);
|
||||
Intent intent = new Intent(getContext(), MainActivity.class);
|
||||
intent.putExtra("deviceId", getDeviceId());
|
||||
intent.putExtra("notificationId", notificationId);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
Intent acceptIntent = new Intent(getContext(), MaterialActivity.class);
|
||||
Intent rejectIntent = new Intent(getContext(), MaterialActivity.class);
|
||||
Intent acceptIntent = new Intent(getContext(), MainActivity.class);
|
||||
Intent rejectIntent = new Intent(getContext(), MainActivity.class);
|
||||
|
||||
acceptIntent.putExtra("deviceId", getDeviceId());
|
||||
acceptIntent.putExtra("notificationId", notificationId);
|
||||
acceptIntent.setAction("action " + System.currentTimeMillis());
|
||||
acceptIntent.putExtra(MaterialActivity.PAIR_REQUEST_STATUS, MaterialActivity.PAIRING_ACCEPTED);
|
||||
acceptIntent.putExtra(MainActivity.PAIR_REQUEST_STATUS, MainActivity.PAIRING_ACCEPTED);
|
||||
|
||||
rejectIntent.putExtra("deviceId", getDeviceId());
|
||||
rejectIntent.putExtra("notificationId", notificationId);
|
||||
rejectIntent.setAction("action " + System.currentTimeMillis());
|
||||
rejectIntent.putExtra(MaterialActivity.PAIR_REQUEST_STATUS, MaterialActivity.PAIRING_REJECTED);
|
||||
rejectIntent.putExtra(MainActivity.PAIR_REQUEST_STATUS, MainActivity.PAIRING_REJECTED);
|
||||
|
||||
PendingIntent acceptedPendingIntent = PendingIntent.getActivity(getContext(), 2, acceptIntent, PendingIntent.FLAG_ONE_SHOT);
|
||||
PendingIntent rejectedPendingIntent = PendingIntent.getActivity(getContext(), 4, rejectIntent, PendingIntent.FLAG_ONE_SHOT);
|
||||
|
@ -45,7 +45,7 @@ import android.util.Log;
|
||||
import org.kde.kdeconnect.Helpers.AppsHelper;
|
||||
import org.kde.kdeconnect.NetworkPackage;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.MaterialActivity;
|
||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||
import org.kde.kdeconnect.UserInterface.SettingsActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
@ -497,7 +497,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
|
||||
deviceActivity.startActivityForResult(intent, MaterialActivity.RESULT_NEEDS_RELOAD);
|
||||
deviceActivity.startActivityForResult(intent, MainActivity.RESULT_NEEDS_RELOAD);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
|
@ -33,7 +33,7 @@ import android.util.Log;
|
||||
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
||||
import org.kde.kdeconnect.NetworkPackage;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.MaterialActivity;
|
||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
|
||||
@ -62,8 +62,8 @@ public class PingPlugin extends Plugin {
|
||||
//Log.e("PingPackageReceiver", "was a ping!");
|
||||
|
||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||
stackBuilder.addParentStack(MaterialActivity.class);
|
||||
stackBuilder.addNextIntent(new Intent(context, MaterialActivity.class));
|
||||
stackBuilder.addParentStack(MainActivity.class);
|
||||
stackBuilder.addNextIntent(new Intent(context, MainActivity.class));
|
||||
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(
|
||||
0,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
|
@ -35,7 +35,7 @@ import android.util.Log;
|
||||
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
||||
import org.kde.kdeconnect.NetworkPackage;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.MaterialActivity;
|
||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
import java.io.InputStream;
|
||||
@ -76,8 +76,8 @@ public class ReceiveNotificationsPlugin extends Plugin {
|
||||
Log.e("NotificationsPlugin", "Received notification package lacks properties");
|
||||
} else {
|
||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||
stackBuilder.addParentStack(MaterialActivity.class);
|
||||
stackBuilder.addNextIntent(new Intent(context, MaterialActivity.class));
|
||||
stackBuilder.addParentStack(MainActivity.class);
|
||||
stackBuilder.addNextIntent(new Intent(context, MainActivity.class));
|
||||
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(
|
||||
0,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
|
@ -33,7 +33,7 @@ import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.kde.kdeconnect.UserInterface.MaterialActivity;
|
||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||
import org.kde.kdeconnect.UserInterface.PluginSettingsActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
@ -174,7 +174,7 @@ public class RemoteKeyboardService
|
||||
startActivity(intent);
|
||||
}
|
||||
} else { // != 1 instance of plugin -> show main activity view
|
||||
Intent intent = new Intent(this, MaterialActivity.class);
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.putExtra("forceOverview", true);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
|
@ -68,7 +68,7 @@ public class DeviceFragment extends Fragment {
|
||||
static String mDeviceId; //Static because if we get here by using the back button in the action bar, the extra deviceId will not be set.
|
||||
Device device;
|
||||
|
||||
MaterialActivity mActivity;
|
||||
MainActivity mActivity;
|
||||
|
||||
ArrayList<ListAdapter.Item> pluginListItems;
|
||||
|
||||
@ -82,7 +82,7 @@ public class DeviceFragment extends Fragment {
|
||||
this.setArguments(args);
|
||||
}
|
||||
|
||||
public DeviceFragment(String deviceId, MaterialActivity activity) {
|
||||
public DeviceFragment(String deviceId, MainActivity activity) {
|
||||
this.mActivity = activity;
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_DEVICE_ID, deviceId);
|
||||
@ -92,7 +92,7 @@ public class DeviceFragment extends Fragment {
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
mActivity = ((MaterialActivity) getActivity());
|
||||
mActivity = ((MainActivity) getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -436,7 +436,7 @@ public class DeviceFragment extends Fragment {
|
||||
|
||||
};
|
||||
|
||||
public static void acceptPairing(final String devId, final MaterialActivity activity) {
|
||||
public static void acceptPairing(final String devId, final MainActivity activity) {
|
||||
final DeviceFragment frag = new DeviceFragment(devId, activity);
|
||||
BackgroundService.RunCommand(activity, new BackgroundService.InstanceCallback() {
|
||||
public void onServiceStart(BackgroundService service) {
|
||||
@ -459,7 +459,7 @@ public class DeviceFragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
public static void rejectPairing(final String devId, final MaterialActivity activity) {
|
||||
public static void rejectPairing(final String devId, final MainActivity activity) {
|
||||
final DeviceFragment frag = new DeviceFragment(devId, activity);
|
||||
BackgroundService.RunCommand(activity, new BackgroundService.InstanceCallback() {
|
||||
public void onServiceStart(BackgroundService service) {
|
||||
|
@ -33,7 +33,7 @@ import org.kde.kdeconnect_tp.R;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class MaterialActivity extends AppCompatActivity {
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private static final String STATE_SELECTED_DEVICE = "selected_device";
|
||||
|
||||
@ -109,24 +109,24 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
String savedDevice;
|
||||
String pairStatus = "";
|
||||
if (getIntent().hasExtra("forceOverview")) {
|
||||
Log.i("MaterialActivity", "Requested to start main overview");
|
||||
Log.i("MainActivity", "Requested to start main overview");
|
||||
savedDevice = null;
|
||||
} else if (getIntent().hasExtra("deviceId")) {
|
||||
Log.i("MaterialActivity", "Loading selected device from parameter");
|
||||
Log.i("MainActivity", "Loading selected device from parameter");
|
||||
savedDevice = getIntent().getStringExtra("deviceId");
|
||||
if (getIntent().hasExtra(PAIR_REQUEST_STATUS)) {
|
||||
pairStatus = getIntent().getStringExtra(PAIR_REQUEST_STATUS);
|
||||
}
|
||||
} else if (savedInstanceState != null) {
|
||||
Log.i("MaterialActivity", "Loading selected device from saved activity state");
|
||||
Log.i("MainActivity", "Loading selected device from saved activity state");
|
||||
savedDevice = savedInstanceState.getString(STATE_SELECTED_DEVICE);
|
||||
} else {
|
||||
Log.i("MaterialActivity", "Loading selected device from persistent storage");
|
||||
Log.i("MainActivity", "Loading selected device from persistent storage");
|
||||
savedDevice = preferences.getString(STATE_SELECTED_DEVICE, null);
|
||||
}
|
||||
//if pairStatus is not empty, then the decision has been made...
|
||||
if (!pairStatus.equals("")) {
|
||||
Log.i("MaterialActivity", "pair status is " + pairStatus);
|
||||
Log.i("MainActivity", "pair status is " + pairStatus);
|
||||
onNewDeviceSelected(savedDevice, pairStatus);
|
||||
}
|
||||
onDeviceSelected(savedDevice);
|
||||
@ -172,9 +172,9 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
|
||||
private void updateComputerList() {
|
||||
|
||||
//Log.e("MaterialActivity", "UpdateComputerList");
|
||||
//Log.e("MainActivity", "UpdateComputerList");
|
||||
|
||||
BackgroundService.RunCommand(MaterialActivity.this, new BackgroundService.InstanceCallback() {
|
||||
BackgroundService.RunCommand(MainActivity.this, new BackgroundService.InstanceCallback() {
|
||||
@Override
|
||||
public void onServiceStart(final BackgroundService service) {
|
||||
|
||||
@ -211,7 +211,7 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() {
|
||||
@Override
|
||||
public void onServiceStart(BackgroundService service) {
|
||||
service.addDeviceListChangedCallback("MaterialActivity", new BackgroundService.DeviceListChangedCallback() {
|
||||
service.addDeviceListChangedCallback("MainActivity", new BackgroundService.DeviceListChangedCallback() {
|
||||
@Override
|
||||
public void onDeviceListChanged() {
|
||||
updateComputerList();
|
||||
@ -228,7 +228,7 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() {
|
||||
@Override
|
||||
public void onServiceStart(BackgroundService service) {
|
||||
service.removeDeviceListChangedCallback("MaterialActivity");
|
||||
service.removeDeviceListChangedCallback("MainActivity");
|
||||
}
|
||||
});
|
||||
super.onStop();
|
||||
@ -313,8 +313,8 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
|
||||
public void renameDevice() {
|
||||
final TextView nameView = (TextView) mNavigationView.findViewById(R.id.device_name);
|
||||
final EditText deviceNameEdit = new EditText(MaterialActivity.this);
|
||||
String deviceName = DeviceHelper.getDeviceName(MaterialActivity.this);
|
||||
final EditText deviceNameEdit = new EditText(MainActivity.this);
|
||||
String deviceName = DeviceHelper.getDeviceName(MainActivity.this);
|
||||
deviceNameEdit.setText(deviceName);
|
||||
deviceNameEdit.setPadding(
|
||||
((int) (18 * getResources().getDisplayMetrics().density)),
|
||||
@ -322,15 +322,15 @@ public class MaterialActivity extends AppCompatActivity {
|
||||
((int) (18 * getResources().getDisplayMetrics().density)),
|
||||
((int) (12 * getResources().getDisplayMetrics().density))
|
||||
);
|
||||
new AlertDialog.Builder(MaterialActivity.this)
|
||||
new AlertDialog.Builder(MainActivity.this)
|
||||
.setView(deviceNameEdit)
|
||||
.setPositiveButton(R.string.device_rename_confirm, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String deviceName = deviceNameEdit.getText().toString();
|
||||
DeviceHelper.setDeviceName(MaterialActivity.this, deviceName);
|
||||
DeviceHelper.setDeviceName(MainActivity.this, deviceName);
|
||||
nameView.setText(deviceName);
|
||||
BackgroundService.RunCommand(MaterialActivity.this, new BackgroundService.InstanceCallback() {
|
||||
BackgroundService.RunCommand(MainActivity.this, new BackgroundService.InstanceCallback() {
|
||||
@Override
|
||||
public void onServiceStart(final BackgroundService service) {
|
||||
service.onNetworkChange();
|
@ -58,7 +58,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
||||
|
||||
private View rootView;
|
||||
private SwipeRefreshLayout mSwipeRefreshLayout;
|
||||
private MaterialActivity mActivity;
|
||||
private MainActivity mActivity;
|
||||
|
||||
boolean listRefreshCalledThisFrame = false;
|
||||
|
||||
@ -97,7 +97,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
mActivity = ((MaterialActivity) getActivity());
|
||||
mActivity = ((MainActivity) getActivity());
|
||||
}
|
||||
|
||||
private void updateComputerListAction() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user