Kaydet (Commit) e25d4e7d authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Linked ABS. Migrated Settings Activity to v4 + ABS.

Change-Id: I93195124aafd8472671a2cf4edddd82c37789016
üst 1be58f5c
......@@ -9,4 +9,4 @@
android.library=true
# Project target.
target=android-14
target=android-15
......@@ -4,5 +4,6 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry combineaccessrules="false" kind="src" path="/abs-lib"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
......@@ -12,3 +12,4 @@
# Project target.
target=android-15
android.library.reference.1=../abs-lib/
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/settings_fragment"
android:name="org.libreoffice.impressremote.SettingsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
......@@ -13,7 +13,6 @@ import java.text.MessageFormat;
import org.libreoffice.impressremote.communication.CommunicationService;
import org.libreoffice.impressremote.communication.CommunicationService.State;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
......@@ -25,7 +24,9 @@ import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
import android.widget.TextView;
public class PairingActivity extends Activity {
import com.actionbarsherlock.app.SherlockActivity;
public class PairingActivity extends SherlockActivity {
private CommunicationService mCommunicationService;
private boolean mIsBound = false;
private TextView mPinText;
......
package org.libreoffice.impressremote;
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
public class SettingsActivity extends Activity {
import com.actionbarsherlock.app.SherlockPreferenceActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
public class SettingsActivity extends SherlockPreferenceActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
// We use addPreferencesFromResource as we need sdk-9 compatibility
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
addPreferencesFromResource(R.xml.preferences);
}
@Override
public boolean onOptionsItemSelected(
com.actionbarsherlock.view.MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
package org.libreoffice.impressremote;
import android.os.Bundle;
import android.preference.PreferenceFragment;
public class SettingsFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
}
}
Markdown is supported
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