Changes
This commit is contained in:
@@ -23,18 +23,15 @@
|
||||
package org.solovyev.android.calculator.variables;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import org.solovyev.android.calculator.BaseActivity;
|
||||
import org.solovyev.android.calculator.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.R;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class VariablesActivity extends BaseActivity {
|
||||
|
||||
public static final String EXTRA_VARIABLE = "variable";
|
||||
private static final CalculatorFragmentType FRAGMENT_TYPE = CalculatorFragmentType.variables;
|
||||
|
||||
public VariablesActivity() {
|
||||
super(R.layout.main_empty, VariablesActivity.class.getSimpleName());
|
||||
@@ -45,7 +42,7 @@ public class VariablesActivity extends BaseActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
for (VariableCategory category : VariableCategory.values()) {
|
||||
addTab(category);
|
||||
addTab(category, CalculatorFragmentType.variables);
|
||||
}
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
@@ -56,12 +53,4 @@ public class VariablesActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addTab(@Nonnull VariableCategory category) {
|
||||
final Bundle arguments = new Bundle(1);
|
||||
arguments.putString(VariablesFragment.ARG_CATEGORY, category.name());
|
||||
final String fragmentTag = FRAGMENT_TYPE.createSubFragmentTag(category.name());
|
||||
final Class<? extends Fragment> fragmentClass = FRAGMENT_TYPE.getFragmentClass();
|
||||
ui.addTab(this, fragmentTag, fragmentClass, arguments, category.title(), R.id.main_layout);
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ import org.solovyev.android.calculator.*;
|
||||
import org.solovyev.android.calculator.entities.Category;
|
||||
import org.solovyev.android.calculator.entities.EntityRemovalDialog;
|
||||
import org.solovyev.android.calculator.math.MathType;
|
||||
import org.solovyev.android.calculator.math.edit.BaseEntitiesFragment;
|
||||
import org.solovyev.android.calculator.entities.BaseEntitiesFragment;
|
||||
import org.solovyev.common.JPredicate;
|
||||
import org.solovyev.common.collections.Collections;
|
||||
import org.solovyev.common.text.Strings;
|
||||
@@ -160,10 +160,7 @@ public class VariablesFragment extends BaseEntitiesFragment<IConstant> {
|
||||
});
|
||||
return true;
|
||||
case R.string.c_copy_value:
|
||||
final String value = constant.getValue();
|
||||
if (!Strings.isEmpty(value)) {
|
||||
Locator.getInstance().getClipboard().setText(value);
|
||||
}
|
||||
copyText(constant.getValue());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user