Sherlock -> AppCompat

This commit is contained in:
serso 2015-01-27 15:08:47 +01:00
parent 52ed2d0071
commit 68636d8278
60 changed files with 1309 additions and 189 deletions

View File

@ -71,40 +71,36 @@
<orderEntry type="library" exported="" scope="TEST" name="wagon-http-shared-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xercesMinimal-1.9.6.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="nekohtml-1.9.6.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="simple-xml-2.6.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="core" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="commons-cli-1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="annotations-2.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="core" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="internal_impl-21.0.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="stax-1.2.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="common-msg-1.0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="common-listeners-1.0.7" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="guava-11.0.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="common-text-1.0.7" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="library-2.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="acra-4.5.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_android_calculatorpp_android_app_build_intermediates_exploded_aar_com_melnykov_floatingactionbutton_1_1_0_classes_jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="internal_impl-21.0.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="common-core-1.0.7" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="jscl-1.0.8" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="common-security-1.0.7" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_android_calculatorpp_android_app_build_intermediates_exploded_aar_com_android_support_recyclerview_v7_21_0_0_classes_jar" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classes" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_android_calculatorpp_android_app_build_intermediates_classes_debug" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_android_calculatorpp_android_app_build_intermediates_dependency_cache_debug" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_serso_android_calculatorpp_android_app_build_intermediates_classes_debug" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="_home_serso_projects_java_serso_android_calculatorpp_android_app_build_intermediates_dependency_cache_debug" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="android" level="project" />
</component>
</module>

View File

@ -81,18 +81,15 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 21 Platform (Local)" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="play-services-6.5.87" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="android-common-db-1.1.18" level="project" />
<orderEntry type="library" exported="" name="acra-4.5.0" level="project" />
<orderEntry type="library" exported="" name="actionbarsherlock-4.4.0" level="project" />
<orderEntry type="library" exported="" name="annotations-2.0.1" level="project" />
<orderEntry type="library" exported="" name="android-common-security-1.1.18" level="project" />
<orderEntry type="library" exported="" name="common-core-1.0.7" level="project" />
<orderEntry type="library" exported="" name="android-common-wizard-1.1.18" level="project" />
<orderEntry type="library" exported="" name="common-listeners-1.0.7" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="common-text-1.0.7" level="project" />
<orderEntry type="library" exported="" name="jscl-1.0.8" level="project" />
<orderEntry type="library" exported="" name="android-common-views-1.1.18" level="project" />
@ -101,8 +98,8 @@
<orderEntry type="library" exported="" name="android-common-menus-1.1.18" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.0" level="project" />
<orderEntry type="library" exported="" name="common-security-1.0.7" level="project" />
<orderEntry type="library" exported="" name="checkout-0.6.0" level="project" />
<orderEntry type="library" exported="" name="android-common-core-1.1.18" level="project" />
<orderEntry type="library" exported="" name="checkout-0.6.0" level="project" />
<orderEntry type="library" exported="" name="common-msg-1.0.5" level="project" />
<orderEntry type="library" exported="" name="android-common-other-1.1.18" level="project" />
<orderEntry type="library" exported="" name="floatingactionbutton-1.1.0" level="project" />
@ -110,7 +107,6 @@
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="android-common-lists-1.1.18" level="project" />
<orderEntry type="library" exported="" name="guava-11.0.2" level="project" />
<orderEntry type="library" exported="" name="android-common-sherlock-1.1.18" level="project" />
<orderEntry type="library" exported="" name="commons-cli-1.2" level="project" />
<orderEntry type="library" exported="" name="simple-xml-2.6.1" level="project" />
<orderEntry type="module" module-name="core" exported="" />

View File

@ -56,16 +56,13 @@ dependencies {
compile 'org.solovyev:common-text:1.0.7'
compile 'org.solovyev:common-security:1.0.7'
compile 'com.android.support:support-v4:21.0.3'
compile ('ch.acra:acra:4.5.0') {
compile 'com.android.support:appcompat-v7:21.0.3'
compile('ch.acra:acra:4.5.0') {
exclude group: 'org.json'
}
compile 'org.solovyev.android:android-common-sherlock:1.1.18@aar'
compile 'org.solovyev.android:android-common-lists:1.1.18@aar'
compile 'org.solovyev.android:android-common-wizard:1.1.18@aar'
compile 'org.solovyev.android:android-common-core:1.1.18@aar'
compile 'org.solovyev.android:android-common-other:1.1.18@aar'
compile 'org.solovyev.android:android-common-db:1.1.18@aar'
compile 'org.solovyev.android:android-common-security:1.1.18@aar'
compile 'org.solovyev.android:android-common-views:1.1.18@aar'
compile 'org.solovyev.android:android-common-menus:1.1.18@aar'
compile 'org.solovyev.android:android-common-preferences:1.1.18@aar'
@ -73,7 +70,6 @@ dependencies {
exclude(module: 'xercesImpl')
}
compile 'org.solovyev.android:checkout:0.6.0@aar'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.google.android.gms:play-services:6.5.87@aar'
compile 'com.melnykov:floatingactionbutton:1.1.0'
}

View File

@ -67,6 +67,9 @@
-dontwarn com.actionbarsherlock.BuildConfig
-dontwarn com.google.android.gms.**
-dontwarn com.melnykov.fab.**
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
-keep class org.simpleframework.xml.** { *; }
-keep class * implements org.solovyev.android.calculator.model.MathPersistenceEntity

View File

@ -66,6 +66,9 @@
-dontwarn com.actionbarsherlock.BuildConfig
-dontwarn com.google.android.gms.**
-dontwarn com.melnykov.fab.**
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
-keep class org.simpleframework.xml.** { *; }
-keep class * implements org.solovyev.android.calculator.model.MathPersistenceEntity

View File

@ -36,8 +36,8 @@ import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.android.Activities;
import org.solovyev.android.Views;
import org.solovyev.android.sherlock.tabs.ActionBarFragmentTabListener;
@ -111,9 +111,8 @@ public class ActivityUi extends BaseUi {
}
}
public void onCreate(@Nonnull final SherlockFragmentActivity activity) {
onCreate((Activity)activity);
public void onCreate(@Nonnull final ActionBarActivity activity) {
onCreate((Activity) activity);
final ActionBar actionBar = activity.getSupportActionBar();
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(homeIcon);
@ -126,7 +125,7 @@ public class ActivityUi extends BaseUi {
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
private void toggleTitle(@Nonnull SherlockFragmentActivity activity, boolean showTitle) {
private void toggleTitle(@Nonnull ActionBarActivity activity, boolean showTitle) {
final ActionBar actionBar = activity.getSupportActionBar();
if (activity instanceof CalculatorActivity) {
@ -140,14 +139,14 @@ public class ActivityUi extends BaseUi {
}
}
public void restoreSavedTab(@Nonnull SherlockFragmentActivity activity) {
public void restoreSavedTab(@Nonnull ActionBarActivity activity) {
final ActionBar actionBar = activity.getSupportActionBar();
if (selectedNavigationIndex >= 0 && selectedNavigationIndex < actionBar.getTabCount()) {
actionBar.setSelectedNavigationItem(selectedNavigationIndex);
}
}
public void onSaveInstanceState(@Nonnull SherlockFragmentActivity activity, @Nonnull Bundle outState) {
public void onSaveInstanceState(@Nonnull ActionBarActivity activity, @Nonnull Bundle outState) {
onSaveInstanceState((Activity) activity, outState);
}
@ -166,7 +165,7 @@ public class ActivityUi extends BaseUi {
public void onPause(@Nonnull Activity activity) {
}
public void onPause(@Nonnull SherlockFragmentActivity activity) {
public void onPause(@Nonnull ActionBarActivity activity) {
onPause((Activity) activity);
final int selectedNavigationIndex = activity.getSupportActionBar().getSelectedNavigationIndex();
@ -193,11 +192,11 @@ public class ActivityUi extends BaseUi {
}
}
public void onDestroy(@Nonnull SherlockFragmentActivity activity) {
public void onDestroy(@Nonnull ActionBarActivity activity) {
this.onDestroy((Activity) activity);
}
public void addTab(@Nonnull SherlockFragmentActivity activity,
public void addTab(@Nonnull ActionBarActivity activity,
@Nonnull String tag,
@Nonnull Class<? extends Fragment> fragmentClass,
@Nullable Bundle fragmentArgs,
@ -214,11 +213,11 @@ public class ActivityUi extends BaseUi {
actionBar.addTab(tab);
}
public void addTab(@Nonnull SherlockFragmentActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) {
public void addTab(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) {
addTab(activity, fragmentType.getFragmentTag(), fragmentType.getFragmentClass(), fragmentArgs, fragmentType.getDefaultTitleResId(), parentViewId);
}
public void setFragment(@Nonnull SherlockFragmentActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) {
public void setFragment(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) {
final FragmentManager fm = activity.getSupportFragmentManager();
Fragment fragment = fm.findFragmentByTag(fragmentType.getFragmentTag());
@ -237,7 +236,7 @@ public class ActivityUi extends BaseUi {
}
}
public void selectTab(@Nonnull SherlockFragmentActivity activity, @Nonnull CalculatorFragmentType fragmentType) {
public void selectTab(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType) {
final ActionBar actionBar = activity.getSupportActionBar();
for (int i = 0; i < actionBar.getTabCount(); i++) {
final ActionBar.Tab tab = actionBar.getTabAt(i);
@ -262,7 +261,7 @@ public class ActivityUi extends BaseUi {
return layout;
}
public void onResume(@Nonnull SherlockFragmentActivity activity) {
public void onResume(@Nonnull ActionBarActivity activity) {
onResume((Activity) activity);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);

View File

@ -2,11 +2,11 @@ package org.solovyev.android.calculator;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
public class BaseActivity extends SherlockFragmentActivity {
public class BaseActivity extends ActionBarActivity {
@Nonnull
protected final ActivityUi ui;

View File

@ -36,8 +36,8 @@ import android.util.Log;
import android.view.*;
import android.widget.Button;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.android.Activities;
import org.solovyev.android.Android;
import org.solovyev.android.Threads;
@ -62,7 +62,7 @@ import static org.solovyev.android.calculator.Preferences.Gui.preventScreenFromF
import static org.solovyev.android.wizard.WizardUi.continueWizard;
import static org.solovyev.android.wizard.WizardUi.startWizard;
public class CalculatorActivity extends SherlockFragmentActivity implements SharedPreferences.OnSharedPreferenceChangeListener, CalculatorEventListener {
public class CalculatorActivity extends ActionBarActivity implements SharedPreferences.OnSharedPreferenceChangeListener, CalculatorEventListener {
@Nonnull
public static final String TAG = CalculatorActivity.class.getSimpleName();
@ -77,6 +77,8 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
*/
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
final Preferences.Gui.Layout layout = Preferences.Gui.layout.getPreferenceNoError(preferences);
@ -85,9 +87,6 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
activityUi.logDebug("onCreate");
activityUi.onCreate(this);
super.onCreate(savedInstanceState);
activityUi.logDebug("super.onCreate");
if (isMultiPane()) {
activityUi.addTab(this, CalculatorFragmentType.history, null, R.id.main_second_pane);
activityUi.addTab(this, CalculatorFragmentType.saved_history, null, R.id.main_second_pane);

View File

@ -32,7 +32,7 @@ import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import jscl.math.Generic;
import org.solovyev.android.Android;
import org.solovyev.android.calculator.about.CalculatorAboutActivity;
@ -129,8 +129,8 @@ public final class CalculatorActivityLauncher implements CalculatorEventListener
final String varValue = viewState.getText();
if (!Strings.isEmpty(varValue)) {
if (CalculatorVarsFragment.isValidValue(varValue)) {
if (context instanceof SherlockFragmentActivity) {
VarEditDialogFragment.showDialog(VarEditDialogFragment.Input.newFromValue(varValue), ((SherlockFragmentActivity) context).getSupportFragmentManager());
if (context instanceof ActionBarActivity) {
VarEditDialogFragment.showDialog(VarEditDialogFragment.Input.newFromValue(varValue), ((ActionBarActivity) context).getSupportFragmentManager());
} else {
final Intent intent = new Intent(context, CalculatorVarsActivity.class);
intent.putExtra(CalculatorVarsFragment.CREATE_VAR_EXTRA_STRING, varValue);

View File

@ -31,7 +31,7 @@ import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -46,7 +46,7 @@ import org.solovyev.common.text.Strings;
* Date: 1/20/13
* Time: 12:50 PM
*/
public class CalculatorDialogActivity extends SherlockFragmentActivity {
public class CalculatorDialogActivity extends ActionBarActivity {
@Nonnull
private static final String TAG = CalculatorDialogActivity.class.getSimpleName();

View File

@ -29,7 +29,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
@ -38,7 +38,7 @@ import javax.annotation.Nonnull;
* Date: 25.09.12
* Time: 12:03
*/
public class CalculatorDisplayFragment extends SherlockFragment {
public class CalculatorDisplayFragment extends Fragment {
@Nonnull
private FragmentUi fragmentHelper;

View File

@ -30,29 +30,29 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import android.support.v4.app.Fragment;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import javax.annotation.Nonnull;
import org.solovyev.android.menu.ActivityMenu;
import org.solovyev.android.menu.ListActivityMenu;
import org.solovyev.android.sherlock.menu.SherlockMenuHelper;
import org.solovyev.android.menu.AndroidMenuHelper;
/**
* User: Solovyev_S
* Date: 25.09.12
* Time: 10:49
*/
public class CalculatorEditorFragment extends SherlockFragment {
public class CalculatorEditorFragment extends Fragment {
@Nonnull
private FragmentUi fragmentHelper;
@Nonnull
private ActivityMenu<Menu, MenuItem> menu = ListActivityMenu.fromEnum(CalculatorMenu.class, SherlockMenuHelper.getInstance());
private ActivityMenu<Menu, MenuItem> menu = ListActivityMenu.fromEnum(CalculatorMenu.class, AndroidMenuHelper.getInstance());
public CalculatorEditorFragment() {
}

View File

@ -28,7 +28,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
@ -37,7 +37,7 @@ import javax.annotation.Nonnull;
* Date: 03.10.12
* Time: 14:18
*/
public abstract class CalculatorFragment extends SherlockFragment {
public abstract class CalculatorFragment extends Fragment {
@Nonnull
private final FragmentUi fragmentHelper;

View File

@ -28,7 +28,7 @@ import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -44,7 +44,7 @@ import static org.solovyev.android.calculator.model.AndroidCalculatorEngine.Pref
* Date: 25.09.12
* Time: 12:25
*/
public class CalculatorKeyboardFragment extends SherlockFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
public class CalculatorKeyboardFragment extends Fragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Nonnull
private Preferences.Gui.Theme theme;

View File

@ -28,7 +28,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockListFragment;
import android.support.v4.app.ListFragment;
import javax.annotation.Nonnull;
@ -37,7 +37,7 @@ import javax.annotation.Nonnull;
* Date: 03.10.12
* Time: 14:18
*/
public abstract class CalculatorListFragment extends SherlockListFragment {
public abstract class CalculatorListFragment extends ListFragment {
@Nonnull
private final FragmentUi fragmentHelper;

View File

@ -26,7 +26,7 @@ import android.app.Activity;
import android.content.Context;
import android.util.Log;
import com.actionbarsherlock.view.MenuItem;
import android.view.MenuItem;
import javax.annotation.Nonnull;

View File

@ -29,21 +29,17 @@ import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.R;
import org.solovyev.common.msg.Message;
import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -53,7 +49,7 @@ import java.util.List;
* Date: 11/17/12
* Time: 3:37 PM
*/
public class FixableMessagesDialog extends SherlockActivity {
public class FixableMessagesDialog extends ActionBarActivity {
private static final String INPUT = "input";

View File

@ -34,7 +34,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import jscl.math.Generic;
import jscl.math.function.Constant;
@ -189,8 +189,8 @@ public class FunctionEditDialogFragment extends DialogFragment implements Calcul
*/
public static void showDialog(@Nonnull Input input, @Nonnull Context context) {
if (context instanceof SherlockFragmentActivity) {
FunctionEditDialogFragment.showDialog(input, ((SherlockFragmentActivity) context).getSupportFragmentManager());
if (context instanceof ActionBarActivity) {
FunctionEditDialogFragment.showDialog(input, ((ActionBarActivity) context).getSupportFragmentManager());
} else {
final Intent intent = new Intent(context, CalculatorFunctionsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View File

@ -35,16 +35,16 @@ import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.actionbarsherlock.app.SherlockListFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import android.support.v4.app.ListFragment;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.melnykov.fab.FloatingActionButton;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.android.menu.*;
import org.solovyev.android.sherlock.menu.SherlockMenuHelper;
import org.solovyev.android.menu.AndroidMenuHelper;
import org.solovyev.common.JPredicate;
import org.solovyev.common.collections.Collections;
import org.solovyev.common.equals.Equalizer;
@ -60,7 +60,7 @@ import java.util.List;
import static org.solovyev.android.calculator.CalculatorEventType.clear_history_requested;
public abstract class BaseHistoryFragment extends SherlockListFragment implements CalculatorEventListener {
public abstract class BaseHistoryFragment extends ListFragment implements CalculatorEventListener {
/*
**********************************************************************
@ -103,7 +103,7 @@ public abstract class BaseHistoryFragment extends SherlockListFragment implement
@Nonnull
private FragmentUi fragmentHelper;
private final ActivityMenu<Menu, MenuItem> menu = ListActivityMenu.fromResource(R.menu.history_menu, HistoryMenu.class, SherlockMenuHelper.getInstance(), new HistoryMenuFilter());
private final ActivityMenu<Menu, MenuItem> menu = ListActivityMenu.fromResource(R.menu.history_menu, HistoryMenu.class, AndroidMenuHelper.getInstance(), new HistoryMenuFilter());
@Nonnull
private final SharedPreferences.OnSharedPreferenceChangeListener preferencesListener = new HistoryOnPreferenceChangeListener();

View File

@ -58,7 +58,7 @@ import org.solovyev.common.filter.Filter;
import org.solovyev.common.math.MathEntity;
import org.solovyev.common.text.Strings;
import com.actionbarsherlock.app.SherlockListFragment;
import android.support.v4.app.ListFragment;
import static org.solovyev.android.calculator.CalculatorEventType.show_wiki_description;
@ -67,7 +67,7 @@ import static org.solovyev.android.calculator.CalculatorEventType.show_wiki_desc
* Date: 12/21/11
* Time: 9:24 PM
*/
public abstract class AbstractMathEntityListFragment<T extends MathEntity> extends SherlockListFragment implements CalculatorEventListener {
public abstract class AbstractMathEntityListFragment<T extends MathEntity> extends ListFragment implements CalculatorEventListener {
/*
**********************************************************************

View File

@ -28,10 +28,10 @@ import android.os.Bundle;
import android.os.Parcelable;
import android.text.ClipboardManager;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import jscl.math.function.Function;
import jscl.math.function.IFunction;
@ -251,7 +251,7 @@ public class CalculatorFunctionsFragment extends AbstractMathEntityListFragment<
@Override
public void onClick(@Nonnull Function function, @Nonnull Context context) {
if (function instanceof IFunction) {
FunctionEditDialogFragment.showDialog(FunctionEditDialogFragment.Input.newFromFunction((IFunction) function), ((SherlockFragmentActivity) context).getSupportFragmentManager());
FunctionEditDialogFragment.showDialog(FunctionEditDialogFragment.Input.newFromFunction((IFunction) function), ((ActionBarActivity) context).getSupportFragmentManager());
}
}
},

View File

@ -25,10 +25,10 @@ package org.solovyev.android.calculator.math.edit;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import jscl.math.function.IConstant;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.math.MathType;
@ -249,7 +249,7 @@ public class CalculatorVarsFragment extends AbstractMathEntityListFragment<ICons
edit(R.string.c_edit) {
@Override
public void onClick(@Nonnull IConstant constant, @Nonnull Context context) {
VarEditDialogFragment.showDialog(VarEditDialogFragment.Input.newFromConstant(constant), ((SherlockFragmentActivity) context).getSupportFragmentManager());
VarEditDialogFragment.showDialog(VarEditDialogFragment.Input.newFromConstant(constant), ((ActionBarActivity) context).getSupportFragmentManager());
}
},

View File

@ -28,7 +28,7 @@ import org.solovyev.android.calculator.EmptyActivity;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;
import static com.actionbarsherlock.app.ActionBar.NAVIGATION_MODE_STANDARD;
import static android.support.v7.app.ActionBar.NAVIGATION_MODE_STANDARD;
/**
* User: Solovyev_S

View File

@ -22,6 +22,7 @@
package org.solovyev.android.calculator.plot;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -32,27 +33,21 @@ import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import org.solovyev.android.Android;
import org.solovyev.android.Threads;
import org.solovyev.android.calculator.*;
import org.solovyev.android.menu.AMenuItem;
import org.solovyev.android.menu.ActivityMenu;
import org.solovyev.android.menu.IdentifiableMenuItem;
import org.solovyev.android.menu.ListActivityMenu;
import org.solovyev.android.sherlock.menu.SherlockMenuHelper;
import org.solovyev.android.calculator.R;
import org.solovyev.android.menu.*;
import org.solovyev.common.JPredicate;
import org.solovyev.common.msg.MessageType;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -140,7 +135,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
PreferenceManager.getDefaultSharedPreferences(this.getActivity()).registerOnSharedPreferenceChangeListener(this);
plotData = Locator.getInstance().getPlotter().getPlotData();
updateChart(plotData, getSherlockActivity());
updateChart(plotData, getActivity());
}
@Override
@ -155,7 +150,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (Preferences.angleUnit.getKey().equals(key)) {
updateChart(this.plotData, getSherlockActivity());
updateChart(this.plotData, getActivity());
}
}
@ -176,11 +171,11 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
private void onNewPlotData(@Nonnull final PlotData plotData) {
this.plotData = plotData;
final SherlockFragmentActivity activity = getSherlockActivity();
updateChart(plotData, activity);
updateChart(plotData, getActivity());
}
private void updateChart(@Nonnull final PlotData plotData, @Nullable final SherlockFragmentActivity activity) {
private void updateChart(@Nonnull final PlotData plotData, @Nullable final Activity activity) {
if (!(activity instanceof ActionBarActivity)) throw new AssertionError();
Threads.tryRunOnUiThread(activity, new Runnable() {
@Override
public void run() {
@ -191,8 +186,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
createGraphicalView(view, plotData);
}
if (activity == null) throw new AssertionError();
activity.invalidateOptionsMenu();
((ActionBarActivity) activity).supportInvalidateOptionsMenu();
}
});
}
@ -320,7 +314,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
final boolean plot2dVisible = plotData.isPlot3d() && Locator.getInstance().getPlotter().is2dPlotPossible();
final boolean captureScreenshotVisible = isScreenshotSupported();
final boolean fullscreenVisible = isPaneFragment();
fragmentMenu = ListActivityMenu.fromResource(R.menu.plot_menu, menuItems, SherlockMenuHelper.getInstance(), new JPredicate<AMenuItem<MenuItem>>() {
fragmentMenu = ListActivityMenu.fromResource(R.menu.plot_menu, menuItems, AndroidMenuHelper.getInstance(), new JPredicate<AMenuItem<MenuItem>>() {
@Override
public boolean apply(@Nullable AMenuItem<MenuItem> menuItem) {
if (menuItem == plot3dMenuItem) {

View File

@ -32,7 +32,7 @@ import org.solovyev.android.calculator.R;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static com.actionbarsherlock.app.ActionBar.NAVIGATION_MODE_STANDARD;
import static android.support.v7.app.ActionBar.NAVIGATION_MODE_STANDARD;
/**
* User: serso

View File

@ -33,7 +33,7 @@ import android.widget.Button;
import android.widget.SeekBar;
import android.widget.Spinner;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -44,7 +44,7 @@ import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R;
import org.solovyev.android.fragments.FragmentUtils;
public class CalculatorPlotFunctionSettingsActivity extends SherlockFragmentActivity {
public class CalculatorPlotFunctionSettingsActivity extends ActionBarActivity {
private static final String INPUT_FUNCTION_ID = "plot-function-id";

View File

@ -23,7 +23,7 @@
package org.solovyev.android.calculator.plot;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import org.solovyev.android.calculator.CalculatorFragmentType;
@ -41,7 +41,7 @@ import java.util.List;
* Date: 1/13/13
* Time: 5:05 PM
*/
public class CalculatorPlotFunctionsActivity extends SherlockFragmentActivity {
public class CalculatorPlotFunctionsActivity extends ActionBarActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {

View File

@ -26,7 +26,7 @@ import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -43,7 +43,7 @@ import org.solovyev.common.msg.MessageType;
* Date: 1/19/13
* Time: 5:14 PM
*/
public class CalculatorPlotRangeActivity extends SherlockFragmentActivity {
public class CalculatorPlotRangeActivity extends ActionBarActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {

View File

@ -2,8 +2,8 @@ package org.solovyev.android.calculator.preferences;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.LayoutInflater;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import org.solovyev.android.calculator.ActivityUi;
import org.solovyev.android.calculator.AdView;
import org.solovyev.android.calculator.App;
@ -15,7 +15,7 @@ import org.solovyev.android.checkout.ProductTypes;
import javax.annotation.Nonnull;
public abstract class BasePreferencesActivity extends SherlockPreferenceActivity {
public abstract class BasePreferencesActivity extends PreferenceActivity {
private final ActivityCheckout checkout = Checkout.forActivity(this, App.getBilling(), App.getProducts());
private Inventory inventory;

View File

@ -28,7 +28,7 @@ import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.android.calculator.*;
import org.solovyev.android.checkout.*;
import org.solovyev.android.fragments.FragmentUtils;
@ -41,7 +41,7 @@ import javax.annotation.Nullable;
* Date: 1/20/13
* Time: 2:36 PM
*/
public class PurchaseDialogActivity extends SherlockFragmentActivity {
public class PurchaseDialogActivity extends ActionBarActivity {
@Nonnull
private final ActivityCheckout checkout = Checkout.forActivity(this, App.getBilling(), App.getProducts());

View File

@ -27,14 +27,11 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.common.collections.Collections;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.common.collections.Collections;
import java.util.List;
/**
@ -75,27 +72,27 @@ public class FragmentUtils {
}
}
public static void removeFragments(@Nonnull SherlockFragmentActivity activity, @Nonnull String... fragmentTags) {
public static void removeFragments(@Nonnull ActionBarActivity activity, @Nonnull String... fragmentTags) {
removeFragments(activity, Collections.asList(fragmentTags));
}
public static void removeFragments(@Nonnull SherlockFragmentActivity activity, @Nonnull List<String> fragmentTags) {
public static void removeFragments(@Nonnull ActionBarActivity activity, @Nonnull List<String> fragmentTags) {
for (String fragmentTag : fragmentTags) {
removeFragment(activity, fragmentTag);
}
}
public static void detachFragments(@Nonnull SherlockFragmentActivity activity, @Nonnull String... fragmentTags) {
public static void detachFragments(@Nonnull ActionBarActivity activity, @Nonnull String... fragmentTags) {
detachFragments(activity, Collections.asList(fragmentTags));
}
public static void detachFragments(@Nonnull SherlockFragmentActivity activity, @Nonnull List<String> fragmentTags) {
public static void detachFragments(@Nonnull ActionBarActivity activity, @Nonnull List<String> fragmentTags) {
for (String fragmentTag : fragmentTags) {
detachFragment(activity, fragmentTag);
}
}
public static void detachFragment(@Nonnull SherlockFragmentActivity activity, @Nonnull String fragmentTag) {
public static void detachFragment(@Nonnull ActionBarActivity activity, @Nonnull String fragmentTag) {
final Fragment fragment = activity.getSupportFragmentManager().findFragmentByTag(fragmentTag);
if (fragment != null) {
if (!fragment.isDetached()) {
@ -106,7 +103,7 @@ public class FragmentUtils {
}
}
public static void removeFragment(@Nonnull SherlockFragmentActivity activity, @Nonnull String fragmentTag) {
public static void removeFragment(@Nonnull ActionBarActivity activity, @Nonnull String fragmentTag) {
final Fragment fragment = activity.getSupportFragmentManager().findFragmentByTag(fragmentTag);
if (fragment != null) {
if (fragment.isAdded()) {

View File

@ -0,0 +1,80 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.sherlock;
import android.app.Activity;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuInflater;
import javax.annotation.Nonnull;
/**
* User: serso
* Date: 8/13/12
* Time: 2:04 AM
*/
public final class AndroidSherlockUtils {
private AndroidSherlockUtils() {
throw new AssertionError("Not intended for instantiation!");
}
@Nonnull
public static ActionBar getSupportActionBar(@Nonnull Activity activity) {
if (activity instanceof ActionBarActivity) {
return ((ActionBarActivity) activity).getSupportActionBar();
}
throw new IllegalArgumentException(activity.getClass() + " is not supported!");
}
public static ActionBar getSupportActionBar(@Nonnull Fragment fragment) {
return ((ActionBarActivity) fragment.getActivity()).getSupportActionBar();
}
@Nonnull
public static MenuInflater getSupportMenuInflater(@Nonnull Activity activity) {
return activity.getMenuInflater();
}
public static void showDialog(@Nonnull DialogFragment dialogFragment,
@Nonnull String fragmentTag,
@Nonnull FragmentManager fm) {
final FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(fragmentTag);
if (prev != null) {
ft.remove(prev);
}
// Create and show the dialog.
dialogFragment.show(ft, fragmentTag);
}
}

View File

@ -0,0 +1,39 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.sherlock;
import android.support.v4.app.FragmentTransaction;
import javax.annotation.Nonnull;
/**
* User: serso
* Date: 8/7/12
* Time: 11:57 AM
*/
public interface FragmentItem {
public void onSelected(@Nonnull FragmentTransaction ft);
public void onUnselected(@Nonnull FragmentTransaction ft);
}

View File

@ -0,0 +1,116 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.sherlock;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* User: serso
* Date: 8/7/12
* Time: 11:55 AM
*/
public class FragmentItemImpl implements FragmentItem {
@Nonnull
private final ActionBarActivity activity;
// Fragment
@Nonnull
private final String tag;
@Nonnull
private final Class<? extends Fragment> fragmentClass;
@Nullable
private Bundle fragmentArgs;
@Nullable
private Fragment fragment;
@Nullable
private final Integer parentViewId;
/**
* Constructor used each time a new tab is created.
*
* @param activity The host Activity, used to instantiate the fragment
* @param tag The identifier tag for the fragment
* @param fragmentClass The fragment's Class, used to instantiate the fragment
* @param fragmentArgs arguments to be passed to fragment
* @param parentViewId parent view id
*/
public FragmentItemImpl(@Nonnull ActionBarActivity activity,
@Nonnull String tag,
@Nonnull Class<? extends Fragment> fragmentClass,
@Nullable Bundle fragmentArgs,
@Nullable Integer parentViewId) {
this.activity = activity;
this.tag = tag;
this.fragmentClass = fragmentClass;
this.fragmentArgs = fragmentArgs;
this.parentViewId = parentViewId;
final FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
this.fragment = supportFragmentManager.findFragmentByTag(tag);
}
@Override
public void onSelected(@Nonnull FragmentTransaction ft) {
if (fragment == null) {
fragment = activity.getSupportFragmentManager().findFragmentByTag(this.tag);
}
// Check if the fragment is already initialized
if (fragment == null) {
// If not, instantiate and add it to the activity
fragment = Fragment.instantiate(activity, fragmentClass.getName(), fragmentArgs);
if (parentViewId != null) {
ft.add(parentViewId, fragment, tag);
} else {
ft.add(fragment, tag);
}
} else {
if (fragment.isDetached()) {
// If it exists, simply attach it in order to show it
ft.attach(fragment);
}
}
}
@Override
public void onUnselected(@Nonnull FragmentTransaction ft) {
if (fragment != null) {
ft.detach(fragment);
}
}
}

View File

@ -0,0 +1,43 @@
package org.solovyev.android.sherlock;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import javax.annotation.Nonnull;
public class Fragments extends org.solovyev.android.Fragments {
private Fragments() {
}
public static void showDialog(@Nonnull DialogFragment dialogFragment,
@Nonnull String fragmentTag,
@Nonnull FragmentManager fm) {
showDialog(dialogFragment, fragmentTag, fm, true);
}
public static void showDialog(DialogFragment dialogFragment, String fragmentTag, FragmentManager fm, boolean useExisting) {
Fragment prev = fm.findFragmentByTag(fragmentTag);
if (prev != null) {
if (!useExisting) {
final FragmentTransaction ft = fm.beginTransaction();
ft.remove(prev);
ft.addToBackStack(null);
// Create and show the dialog.
dialogFragment.show(ft, fragmentTag);
fm.executePendingTransactions();
}
} else {
final FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
// Create and show the dialog.
dialogFragment.show(ft, fragmentTag);
fm.executePendingTransactions();
}
}
}

View File

@ -0,0 +1,76 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.sherlock.tabs;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import org.solovyev.android.sherlock.FragmentItem;
import org.solovyev.android.sherlock.FragmentItemImpl;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* User: serso
* Date: 8/4/12
* Time: 12:42 PM
*/
public class ActionBarFragmentTabListener implements ActionBar.TabListener {
private final FragmentItem fragmentItem;
/**
* Constructor used each time a new tab is created.
*
* @param activity The host Activity, used to instantiate the fragment
* @param tag The identifier tag for the fragment
* @param fragmentClass The fragment's Class, used to instantiate the fragment
* @param fragmentArgs arguments to be passed to fragment
* @param parentViewId parent view id
*/
public ActionBarFragmentTabListener(@Nonnull ActionBarActivity activity,
@Nonnull String tag,
@Nonnull Class<? extends Fragment> fragmentClass,
@Nullable Bundle fragmentArgs,
@Nullable Integer parentViewId) {
this.fragmentItem = new FragmentItemImpl(activity, tag, fragmentClass, fragmentArgs, parentViewId);
}
/* The following are each of the ActionBar.TabListener callbacks */
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
this.fragmentItem.onSelected(ft);
}
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
this.fragmentItem.onUnselected(ft);
}
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
}
}

View File

@ -0,0 +1,95 @@
package org.solovyev.android.wizard;
import android.content.Context;
import android.content.SharedPreferences;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static android.preference.PreferenceManager.getDefaultSharedPreferences;
public class BaseWizard implements Wizard {
static final String FLOW = "flow";
static final String FLOW_FINISHED = "flow_finished";
@Nonnull
private final String name;
@Nonnull
private final Context context;
@Nonnull
private final WizardFlow flow;
public BaseWizard(@Nonnull String name,
@Nonnull Context context,
@Nonnull WizardFlow flow) {
this.name = name;
this.context = context;
this.flow = flow;
}
@Override
public void saveLastStep(@Nonnull WizardStep step) {
final SharedPreferences preferences = getPreferences();
final SharedPreferences.Editor editor = preferences.edit();
editor.putString(makeLastStepPreferenceKey(name), step.getName());
editor.commit();
}
@Override
public void saveFinished(@Nonnull WizardStep step, boolean forceFinish) {
final SharedPreferences preferences = getPreferences();
final SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(makeFinishedPreferenceKey(name), forceFinish || flow.getNextStep(step) == null);
editor.commit();
}
@Nonnull
private SharedPreferences getPreferences() {
return getDefaultSharedPreferences(context);
}
@Override
@Nullable
public String getLastSavedStepName() {
return getPreferences().getString(makeLastStepPreferenceKey(name), null);
}
@Override
public boolean isFinished() {
return getPreferences().getBoolean(makeFinishedPreferenceKey(name), false);
}
@Override
public boolean isStarted() {
return getLastSavedStepName() != null;
}
@Nonnull
static String makeFinishedPreferenceKey(@Nonnull String flowName) {
return FLOW_FINISHED + ":" + flowName;
}
@Nonnull
static String makeLastStepPreferenceKey(@Nonnull String flowName) {
return FLOW + ":" + flowName;
}
@Override
@Nonnull
public WizardFlow getFlow() {
return flow;
}
@Nonnull
@Override
public String getName() {
return name;
}
}

View File

@ -0,0 +1,44 @@
package org.solovyev.android.wizard;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import javax.annotation.Nonnull;
public abstract class BaseWizardActivity extends ActionBarActivity implements WizardsAware, FinishWizardConfirmationDialog.Listener {
@Nonnull
private WizardUi ui;
protected BaseWizardActivity(int layoutResId) {
ui = new WizardUi<BaseWizardActivity>(this, this, layoutResId);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ui.onCreate(savedInstanceState);
}
@Override
protected void onSaveInstanceState(Bundle out) {
super.onSaveInstanceState(out);
ui.onSaveInstanceState(out);
}
@Override
public void onPause() {
super.onPause();
ui.onPause();
}
@Override
public void onBackPressed() {
ui.onBackPressed();
}
@Override
public void finishWizardAbruptly() {
ui.finishWizardAbruptly();
}
}

View File

@ -0,0 +1,68 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.wizard;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import org.solovyev.android.calculator.R;
import org.solovyev.android.sherlock.AndroidSherlockUtils;
import javax.annotation.Nonnull;
public class FinishWizardConfirmationDialog extends DialogFragment {
@Nonnull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
b.setMessage(R.string.acl_wizard_finish_confirmation);
b.setPositiveButton(R.string.acl_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
((Listener) getActivity()).finishWizardAbruptly();
}
});
b.setNegativeButton(R.string.acl_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dismiss();
}
});
return b.create();
}
public static <A extends FragmentActivity & Listener> void show(@Nonnull A activity) {
if (!(activity instanceof Listener)) {
throw new IllegalArgumentException("Activity should implement " + Listener.class);
}
AndroidSherlockUtils.showDialog(new FinishWizardConfirmationDialog(), FinishWizardConfirmationDialog.class.getSimpleName(), activity.getSupportFragmentManager());
}
public static interface Listener {
void finishWizardAbruptly();
}
}

View File

@ -0,0 +1,81 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.wizard;
import org.solovyev.common.JPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import static org.solovyev.common.collections.Collections.find;
public final class ListWizardFlow implements WizardFlow {
@Nonnull
private final List<WizardStep> steps;
public ListWizardFlow(@Nonnull List<WizardStep> steps) {
this.steps = steps;
}
@Nullable
@Override
public WizardStep getStepByName(@Nonnull final String name) {
return find(steps, new JPredicate<WizardStep>() {
@Override
public boolean apply(@Nullable WizardStep step) {
assert step != null;
return step.getName().equals(name);
}
});
}
@Nullable
@Override
public WizardStep getNextStep(@Nonnull WizardStep step) {
final int i = steps.indexOf(step);
if (i >= 0 && i + 1 < steps.size()) {
return steps.get(i + 1);
} else {
return null;
}
}
@Nullable
@Override
public WizardStep getPrevStep(@Nonnull WizardStep step) {
final int i = steps.indexOf(step);
if (i >= 1) {
return steps.get(i - 1);
} else {
return null;
}
}
@Nonnull
@Override
public WizardStep getFirstStep() {
return steps.get(0);
}
}

View File

@ -0,0 +1,24 @@
package org.solovyev.android.wizard;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface Wizard {
@Nullable
String getLastSavedStepName();
boolean isFinished();
boolean isStarted();
void saveLastStep(@Nonnull WizardStep step);
void saveFinished(@Nonnull WizardStep step, boolean forceFinish);
@Nonnull
WizardFlow getFlow();
@Nonnull
String getName();
}

View File

@ -0,0 +1,41 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.wizard;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface WizardFlow {
@Nullable
WizardStep getStepByName(@Nonnull String name);
@Nullable
WizardStep getNextStep(@Nonnull WizardStep step);
@Nullable
WizardStep getPrevStep(@Nonnull WizardStep step);
@Nonnull
WizardStep getFirstStep();
}

View File

@ -0,0 +1,32 @@
package org.solovyev.android.wizard;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface WizardStep {
@Nonnull
String getFragmentTag();
@Nonnull
Class<? extends Fragment> getFragmentClass();
@Nullable
Bundle getFragmentArgs();
int getTitleResId();
int getNextButtonTitleResId();
boolean onNext(@Nonnull Fragment fragment);
boolean onPrev(@Nonnull Fragment fragment);
boolean isVisible();
@Nonnull
String getName();
}

View File

@ -0,0 +1,333 @@
package org.solovyev.android.wizard;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.Button;
import org.solovyev.android.calculator.R;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
public class WizardUi<A extends FragmentActivity & FinishWizardConfirmationDialog.Listener> {
/*
**********************************************************************
*
* CONSTANTS
*
**********************************************************************
*/
private static final String FLOW = "flow";
private static final String STEP = "step";
/*
**********************************************************************
*
* FIELDS
*
**********************************************************************
*/
private WizardStep step;
private Wizard wizard;
/*
**********************************************************************
*
* VIEWS
*
**********************************************************************
*/
@Nullable
private View prevButton;
@Nonnull
private Button nextButton;
@Nonnull
private final A activity;
@Nonnull
private final WizardsAware wizardsAware;
private final int layoutResId;
public WizardUi(@Nonnull A activity, @Nonnull WizardsAware wizardsAware, int layoutResId) {
this.activity = activity;
this.wizardsAware = wizardsAware;
this.layoutResId = layoutResId;
}
/*
**********************************************************************
*
* LIFECYCLE
*
**********************************************************************
*/
public void onCreate(@Nullable Bundle savedInstanceState) {
activity.setContentView(layoutResId);
prevButton = activity.findViewById(R.id.acl_wizard_prev_button);
nextButton = (Button) activity.findViewById(R.id.acl_wizard_next_button);
String wizardName = activity.getIntent().getStringExtra(FLOW);
String stepName = activity.getIntent().getStringExtra(STEP);
if (savedInstanceState != null) {
wizardName = savedInstanceState.getString(FLOW);
stepName = savedInstanceState.getString(STEP);
}
wizard = wizardsAware.getWizards().getWizard(wizardName);
WizardStep step = null;
if (stepName != null) {
step = wizard.getFlow().getStepByName(stepName);
}
if (step == null) {
step = wizard.getFlow().getFirstStep();
}
setStep(step);
}
public void setStep(@Nonnull WizardStep step) {
if (this.step == null || !this.step.equals(step)) {
hideFragment();
this.step = step;
showFragment();
initTitle();
initNextButton();
initPrevButton();
}
}
private void initTitle() {
activity.setTitle(step.getTitleResId());
}
private void initPrevButton() {
if (prevButton != null) {
final WizardStep prevStep = wizard.getFlow().getPrevStep(step);
if (prevStep == null) {
prevButton.setVisibility(GONE);
prevButton.setOnClickListener(null);
} else {
prevButton.setVisibility(VISIBLE);
prevButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tryGoPrev()) {
setStep(prevStep);
}
}
});
}
}
}
private void initNextButton() {
final WizardStep nextStep = wizard.getFlow().getNextStep(step);
if (nextStep == null) {
nextButton.setText(R.string.acl_wizard_finish);
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tryGoNext()) {
finishWizard();
}
}
});
} else {
nextButton.setText(step.getNextButtonTitleResId());
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tryGoNext()) {
setStep(nextStep);
}
}
});
}
}
public void finishWizardAbruptly() {
finishWizard(true);
}
public void finishWizard() {
finishWizard(false);
}
void finishWizard(boolean forceFinish) {
if (wizard != null && step != null) {
wizard.saveFinished(step, forceFinish);
}
activity.finish();
}
private boolean tryGoPrev() {
if (step == null) {
return true;
} else {
final Fragment fragment = getFragmentManager().findFragmentByTag(step.getFragmentTag());
return fragment == null || step.onPrev(fragment);
}
}
@Nonnull
private FragmentManager getFragmentManager() {
return activity.getSupportFragmentManager();
}
private boolean tryGoNext() {
if (step == null) {
return true;
} else {
final Fragment fragment = getFragmentManager().findFragmentByTag(step.getFragmentTag());
return fragment == null || step.onNext(fragment);
}
}
@Nonnull
private Fragment showFragment() {
final FragmentManager fm = getFragmentManager();
final FragmentTransaction ft = fm.beginTransaction();
Fragment newFragment = fm.findFragmentByTag(step.getFragmentTag());
if (newFragment == null) {
newFragment = Fragment.instantiate(activity, step.getFragmentClass().getName(), step.getFragmentArgs());
ft.add(R.id.acl_wizard_content, newFragment, step.getFragmentTag());
}
ft.commit();
fm.executePendingTransactions();
return newFragment;
}
private void hideFragment() {
final FragmentManager fm = getFragmentManager();
final FragmentTransaction ft = fm.beginTransaction();
if (step != null) {
hideFragmentByTag(fm, ft, step.getFragmentTag());
}
ft.commit();
fm.executePendingTransactions();
}
private void hideFragmentByTag(@Nonnull FragmentManager fm, @Nonnull FragmentTransaction ft, @Nonnull String fragmentTag) {
final Fragment oldFragment = fm.findFragmentByTag(fragmentTag);
if (oldFragment != null) {
ft.remove(oldFragment);
}
}
public void onSaveInstanceState(@Nonnull Bundle out) {
out.putString(FLOW, wizard.getName());
out.putString(STEP, step.getName());
}
public void onPause() {
if (wizard != null && step != null) {
wizard.saveLastStep(step);
}
}
public void onBackPressed() {
FinishWizardConfirmationDialog.show(activity);
}
/*
**********************************************************************
*
* GETTERS
*
**********************************************************************
*/
public WizardStep getStep() {
return step;
}
public WizardFlow getFlow() {
return wizard.getFlow();
}
public Wizard getWizard() {
return wizard;
}
@Nullable
public View getPrevButton() {
return prevButton;
}
public View getNextButton() {
return nextButton;
}
/*
**********************************************************************
*
* STATIC
*
**********************************************************************
*/
public static void startWizard(@Nonnull Wizards wizards, @Nonnull Context context) {
context.startActivity(createLaunchIntent(wizards, null, context));
}
public static void startWizard(@Nonnull Wizards wizards, @Nullable String name, @Nonnull Context context) {
context.startActivity(createLaunchIntent(wizards, name, context));
}
public static void continueWizard(@Nonnull Wizards wizards, @Nonnull String name, @Nonnull Context context) {
final Intent intent = createLaunchIntent(wizards, name, context);
final Wizard wizard = wizards.getWizard(name);
final String step = wizard.getLastSavedStepName();
tryPutStep(intent, step);
context.startActivity(intent);
}
public static void tryPutStep(@Nonnull Intent intent, @Nullable WizardStep step) {
tryPutStep(intent, step != null ? step.getName() : null);
}
private static void tryPutStep(@Nonnull Intent intent, @Nullable String step) {
if (step != null) {
intent.putExtra(STEP, step);
}
}
@Nonnull
private static Intent createLaunchIntent(@Nonnull Wizards wizards, @Nullable String name, @Nonnull Context context) {
final Intent intent = new Intent(context, wizards.getActivityClassName());
intent.putExtra(FLOW, name);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
return intent;
}
}

View File

@ -0,0 +1,15 @@
package org.solovyev.android.wizard;
import android.app.Activity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface Wizards {
@Nonnull
Class<? extends Activity> getActivityClassName();
@Nonnull
public Wizard getWizard(@Nullable String name) throws IllegalArgumentException;
}

View File

@ -0,0 +1,9 @@
package org.solovyev.android.wizard;
import javax.annotation.Nonnull;
public interface WizardsAware {
@Nonnull
Wizards getWizards();
}

View File

@ -23,10 +23,11 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true"
<!-- todo serso: fix me-->
<!-- <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true"
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>
<item android:state_focused="true" android:state_enabled="false"
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>-->
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/default_abs__list_selector_background_transition_holo_dark"/>
<item android:state_focused="false" android:state_pressed="true"

View File

@ -25,10 +25,11 @@
<item android:state_window_focused="false" android:drawable="@android:color/transparent"/>
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true"
<!-- todo serso: fix me-->
<!-- <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true"
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>
<item android:state_focused="true" android:state_enabled="false"
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>
android:drawable="@drawable/abs__list_selector_disabled_holo_dark"/>-->
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/default_abs__list_selector_background_transition_holo_dark"/>
<item android:state_focused="false" android:state_pressed="true"

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2013 serso aka se.solovyev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/abs__spinner_ab_disabled_holo_dark"/>
<item android:state_pressed="true" android:drawable="@drawable/default_abs__spinner_ab_pressed_holo_dark"/>
<item android:state_pressed="false" android:state_focused="true"
android:drawable="@drawable/default_abs__spinner_ab_focused_holo_dark"/>
<item android:drawable="@drawable/abs__spinner_ab_default_holo_dark"/>
</selector>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Wollen Sie den Assistenten wirklich beenden?</string>
<string name="acl_wizard_next">Weiter</string>
<string name="acl_wizard_back">Zurück</string>
<string name="acl_wizard_finish">Beenden</string>
<string name="acl_wizard_start">Wizard starten</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">¿Realmente quiere finalizar el asistente?</string>
<string name="acl_wizard_next">Siguiente</string>
<string name="acl_wizard_back">Atrás</string>
<string name="acl_wizard_finish">Finalizar</string>
<string name="acl_wizard_start">Iniciar el asistente</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Quitter l\'assistant ?</string>
<string name="acl_wizard_next">Suivant</string>
<string name="acl_wizard_back">Retour</string>
<string name="acl_wizard_finish">Terminer</string>
<string name="acl_wizard_start">Commencer l\'assistant</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Vuoi veramente terminare la procedura guidata?</string>
<string name="acl_wizard_next">Successivo</string>
<string name="acl_wizard_back">Indietro</string>
<string name="acl_wizard_finish">Termina</string>
<string name="acl_wizard_start">Avvia la procedura guidata</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Czy na pewno chcesz zakończyć konfigurację programu?</string>
<string name="acl_wizard_next">Następny</string>
<string name="acl_wizard_back">Wstecz</string>
<string name="acl_wizard_finish">Koniec</string>
<string name="acl_wizard_start">Zacznij konfigurację</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Parar a configuração da aplicação?</string>
<string name="acl_wizard_next">Avançar</string>
<string name="acl_wizard_back">Voltar</string>
<string name="acl_wizard_finish">Terminar</string>
<string name="acl_wizard_start">Iniciar assistente de configuração</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Вы действительно хотите завершить визард?</string>
<string name="acl_wizard_next">Далее</string>
<string name="acl_wizard_back">Назад</string>
<string name="acl_wizard_finish">Завершить</string>
<string name="acl_wizard_start">Начать визард</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Ви дійсно бажаєте вийти з майстра?</string>
<string name="acl_wizard_next">Далі</string>
<string name="acl_wizard_back">Назад</string>
<string name="acl_wizard_finish">Завершити</string>
<string name="acl_wizard_start">Запустити майстер</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="acl_wizard_finish_confirmation">Do you really want to finish wizard?</string>
<string name="acl_wizard_next">Next</string>
<string name="acl_wizard_back">Back</string>
<string name="acl_wizard_finish">Finish</string>
<string name="acl_wizard_start">Start wizard</string>
</resources>

View File

@ -115,32 +115,32 @@
<item name="android:layout_width">match_parent</item>
</style>
<style name="cpp_default_actionbar_style" parent="@style/Widget.Sherlock.ActionBar">
<style name="cpp_default_actionbar_style" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/default_abs__ab_transparent_dark_holo</item>
<item name="android:background">@drawable/default_abs__ab_transparent_dark_holo</item>
</style>
<style name="cpp_default_actionbar_tab_style" parent="@style/Widget.Sherlock.ActionBar.TabView">
<style name="cpp_default_actionbar_tab_style" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="background">@drawable/default_abs__tab_indicator_ab_holo</item>
<item name="android:background">@drawable/default_abs__tab_indicator_ab_holo</item>
</style>
<style name="cpp_default_actionbar_close_button_style" parent="@style/Widget.Sherlock.ActionButton.CloseMode">
<style name="cpp_default_actionbar_close_button_style" parent="@style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">@drawable/default_abs__btn_cab_done_holo_dark</item>
<item name="background">@drawable/default_abs__btn_cab_done_holo_dark</item>
</style>
<style name="cpp_default_actionbar_dropdown_style" parent="@style/Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/default_abs__spinner_ab_holo_dark</item>
<item name="background">@drawable/default_abs__spinner_ab_holo_dark</item>
<style name="cpp_default_actionbar_dropdown_style" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<!--<item name="android:background">@drawable/default_abs__spinner_ab_holo_dark</item>
<item name="background">@drawable/default_abs__spinner_ab_holo_dark</item>-->
</style>
<style name="cpp_default_actionbar_dropdown_listview_style" parent="@style/Widget.Sherlock.ListView.DropDown">
<style name="cpp_default_actionbar_dropdown_listview_style" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@drawable/default_abs__list_selector_holo_dark</item>
<!--<item name="listSelector">@drawable/default_abs__list_selector_holo_dark</item>-->
</style>
<style name="cpp_gray_theme" parent="Theme.Sherlock">
<style name="cpp_gray_theme" parent="@style/Theme.AppCompat">
<item name="android:windowBackground">@color/cpp_default_background</item>
<!-- buttons -->
@ -166,7 +166,7 @@
<item name="cpp_pane_style_transparent">@style/cpp_default_pane_style_transparent</item>
<!-- action bar-->
<item name="actionBarTabStyle">@style/cpp_default_actionbar_tab_style</item>
<!--<item name="actionBarTabStyle">@style/cpp_default_actionbar_tab_style</item>
<item name="android:actionBarTabStyle">@style/cpp_default_actionbar_tab_style</item>
<item name="actionBarStyle">@style/cpp_default_actionbar_style</item>
@ -182,10 +182,10 @@
<item name="android:actionDropDownStyle">@style/cpp_default_actionbar_dropdown_style</item>
<item name="dropDownListViewStyle">@style/cpp_default_actionbar_dropdown_listview_style</item>
<item name="android:dropDownListViewStyle">@style/cpp_default_actionbar_dropdown_listview_style</item>
<item name="android:dropDownListViewStyle">@style/cpp_default_actionbar_dropdown_listview_style</item>-->
</style>
<style name="cpp_gray_dialog_theme" parent="@android:style/Theme.Dialog">
<style name="cpp_gray_dialog_theme" parent="@style/Theme.AppCompat.Dialog">
<item name="android:windowCloseOnTouchOutside">false</item>
<!-- buttons -->
<item name="cpp_digit_button_style">@style/cpp_default_digit_button_style</item>

View File

@ -52,7 +52,7 @@
<item name="android:background">@drawable/metro_blue_list_item</item>
</style>
<style name="metro_blue_actionbar_style" parent="@style/Widget.Sherlock.ActionBar">
<style name="metro_blue_actionbar_style" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/metro_blue_abs__ab_transparent_dark_holo</item>
<item name="android:background">@drawable/metro_blue_abs__ab_transparent_dark_holo</item>
</style>