From 07d3ebd65c6a5ddf4c42c08aada65000765c1202 Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 20 Feb 2016 13:34:55 +0100 Subject: [PATCH] Remove layout files --- .../android/calculator/BaseFragment.java | 2 +- .../calculator/CalculatorActivity.java | 4 - .../android/calculator/DisplayFragment.java | 2 +- .../android/calculator/EditorFragment.java | 2 +- .../android/calculator/FragmentUi.java | 25 ---- .../main/res/layout-land/main_calculator.xml | 59 ++++++++- .../layout-land/main_calculator_mobile.xml | 31 ----- .../main/res/layout-land/main_first_pane.xml | 86 ------------ .../layout-land/main_first_pane_mobile.xml | 84 ------------ .../layout-large-land/cpp_app_keyboard.xml | 112 ---------------- .../res/layout-large-land/main_calculator.xml | 78 ----------- .../main/res/layout-large/cpp_app_display.xml | 41 ------ .../main/res/layout-large/cpp_app_editor.xml | 45 ------- .../res/layout-large/cpp_app_keyboard.xml | 114 ---------------- .../main/res/layout-large/main_calculator.xml | 78 ----------- .../layout-xlarge-land/cpp_app_keyboard.xml | 101 --------------- .../layout-xlarge-land/main_calculator.xml | 79 ------------ .../res/layout-xlarge/cpp_app_display.xml | 41 ------ .../main/res/layout-xlarge/cpp_app_editor.xml | 45 ------- .../res/layout-xlarge/cpp_app_keyboard.xml | 122 ------------------ .../res/layout-xlarge/main_calculator.xml | 78 ----------- app/src/main/res/layout/cpp_plot_fragment.xml | 6 - .../main/res/layout/cpp_plotter_fragment.xml | 6 - app/src/main/res/layout/fragment_entities.xml | 6 - app/src/main/res/layout/fragment_history.xml | 6 - .../res/layout/main_calculator_mobile.xml | 69 ---------- 26 files changed, 59 insertions(+), 1263 deletions(-) delete mode 100644 app/src/main/res/layout-land/main_calculator_mobile.xml delete mode 100644 app/src/main/res/layout-land/main_first_pane.xml delete mode 100644 app/src/main/res/layout-land/main_first_pane_mobile.xml delete mode 100644 app/src/main/res/layout-large-land/cpp_app_keyboard.xml delete mode 100644 app/src/main/res/layout-large-land/main_calculator.xml delete mode 100644 app/src/main/res/layout-large/cpp_app_display.xml delete mode 100644 app/src/main/res/layout-large/cpp_app_editor.xml delete mode 100644 app/src/main/res/layout-large/cpp_app_keyboard.xml delete mode 100644 app/src/main/res/layout-large/main_calculator.xml delete mode 100644 app/src/main/res/layout-xlarge-land/cpp_app_keyboard.xml delete mode 100644 app/src/main/res/layout-xlarge-land/main_calculator.xml delete mode 100644 app/src/main/res/layout-xlarge/cpp_app_display.xml delete mode 100644 app/src/main/res/layout-xlarge/cpp_app_editor.xml delete mode 100644 app/src/main/res/layout-xlarge/cpp_app_keyboard.xml delete mode 100644 app/src/main/res/layout-xlarge/main_calculator.xml delete mode 100644 app/src/main/res/layout/main_calculator_mobile.xml diff --git a/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java b/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java index 54b0050a..8f3eb063 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java @@ -27,7 +27,7 @@ public abstract class BaseFragment extends Fragment { @Nonnull protected final FragmentUi createUi(@Nonnull FragmentTab tab) { - return new FragmentUi(tab.layout, tab.title); + return new FragmentUi(tab.layout); } protected void inject(@Nonnull AppComponent component) { diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index 60d16e82..a6c889e9 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -204,10 +204,6 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference return ViewConfiguration.get(this).hasPermanentMenuKey(); } - private boolean isMultiPane() { - return findViewById(R.id.main_second_pane) != null; - } - @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { diff --git a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java index 6f0309cb..351c3644 100644 --- a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java @@ -96,7 +96,7 @@ public class DisplayFragment extends BaseFragment implements View.OnClickListene @Nonnull @Override protected FragmentUi createUi() { - return new FragmentUi(R.layout.cpp_app_display, R.string.result); + return new FragmentUi(R.layout.cpp_app_display); } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java index 2d5591d2..85bf428c 100644 --- a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java @@ -65,7 +65,7 @@ public class EditorFragment extends BaseFragment { @Nonnull @Override protected FragmentUi createUi() { - return new FragmentUi(R.layout.cpp_app_editor, R.string.editor); + return new FragmentUi(R.layout.cpp_app_editor); } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/FragmentUi.java b/app/src/main/java/org/solovyev/android/calculator/FragmentUi.java index 87654e02..9e696e71 100644 --- a/app/src/main/java/org/solovyev/android/calculator/FragmentUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/FragmentUi.java @@ -26,7 +26,6 @@ import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; import butterknife.Bind; import butterknife.ButterKnife; import org.solovyev.android.checkout.CppCheckout; @@ -36,37 +35,21 @@ import org.solovyev.android.checkout.ProductTypes; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import java.util.Locale; import static org.solovyev.android.calculator.App.cast; public class FragmentUi { private final int layoutId; - private final int titleId; - @Nullable private Boolean adFree = null; - @Inject CppCheckout checkout; @Nullable - @Bind(R.id.fragment_title) - TextView fragmentTitle; - @Nullable @Bind(R.id.admob) AdView adView; public FragmentUi(int layoutId) { - this(layoutId, View.NO_ID); - } - - public FragmentUi(int layoutId, int titleId) { this.layoutId = layoutId; - this.titleId = titleId; - } - - public boolean isPane(@Nonnull Fragment fragment) { - return fragment.getActivity() instanceof CalculatorActivity; } public void onCreate(@Nonnull Fragment fragment) { @@ -113,14 +96,6 @@ public class FragmentUi { } else if (adView != null) { updateAdView(); } - - if (titleId != View.NO_ID && fragmentTitle != null) { - if (isPane(fragment)) { - fragmentTitle.setText(fragment.getString(titleId).toUpperCase(Locale.getDefault())); - } else { - fragmentTitle.setVisibility(View.GONE); - } - } } public void onDestroy() { diff --git a/app/src/main/res/layout-land/main_calculator.xml b/app/src/main/res/layout-land/main_calculator.xml index b926befe..ce0282ae 100644 --- a/app/src/main/res/layout-land/main_calculator.xml +++ b/app/src/main/res/layout-land/main_calculator.xml @@ -21,11 +21,64 @@ ~ Email: se.solovyev@gmail.com ~ Site: http://se.solovyev.org --> - - + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-land/main_calculator_mobile.xml b/app/src/main/res/layout-land/main_calculator_mobile.xml deleted file mode 100644 index 9e36701a..00000000 --- a/app/src/main/res/layout-land/main_calculator_mobile.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout-land/main_first_pane.xml b/app/src/main/res/layout-land/main_first_pane.xml deleted file mode 100644 index 148b50aa..00000000 --- a/app/src/main/res/layout-land/main_first_pane.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-land/main_first_pane_mobile.xml b/app/src/main/res/layout-land/main_first_pane_mobile.xml deleted file mode 100644 index bd247d9e..00000000 --- a/app/src/main/res/layout-land/main_first_pane_mobile.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-large-land/cpp_app_keyboard.xml b/app/src/main/res/layout-large-land/cpp_app_keyboard.xml deleted file mode 100644 index b3f36f4f..00000000 --- a/app/src/main/res/layout-large-land/cpp_app_keyboard.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-large-land/main_calculator.xml b/app/src/main/res/layout-large-land/main_calculator.xml deleted file mode 100644 index ca348da8..00000000 --- a/app/src/main/res/layout-large-land/main_calculator.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-large/cpp_app_display.xml b/app/src/main/res/layout-large/cpp_app_display.xml deleted file mode 100644 index 40aedda7..00000000 --- a/app/src/main/res/layout-large/cpp_app_display.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-large/cpp_app_editor.xml b/app/src/main/res/layout-large/cpp_app_editor.xml deleted file mode 100644 index 9716b95e..00000000 --- a/app/src/main/res/layout-large/cpp_app_editor.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-large/cpp_app_keyboard.xml b/app/src/main/res/layout-large/cpp_app_keyboard.xml deleted file mode 100644 index b09bc6ba..00000000 --- a/app/src/main/res/layout-large/cpp_app_keyboard.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-large/main_calculator.xml b/app/src/main/res/layout-large/main_calculator.xml deleted file mode 100644 index f269f106..00000000 --- a/app/src/main/res/layout-large/main_calculator.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-xlarge-land/cpp_app_keyboard.xml b/app/src/main/res/layout-xlarge-land/cpp_app_keyboard.xml deleted file mode 100644 index d84cd7a6..00000000 --- a/app/src/main/res/layout-xlarge-land/cpp_app_keyboard.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge-land/main_calculator.xml b/app/src/main/res/layout-xlarge-land/main_calculator.xml deleted file mode 100644 index 87771b90..00000000 --- a/app/src/main/res/layout-xlarge-land/main_calculator.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-xlarge/cpp_app_display.xml b/app/src/main/res/layout-xlarge/cpp_app_display.xml deleted file mode 100644 index 40aedda7..00000000 --- a/app/src/main/res/layout-xlarge/cpp_app_display.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/cpp_app_editor.xml b/app/src/main/res/layout-xlarge/cpp_app_editor.xml deleted file mode 100644 index 9716b95e..00000000 --- a/app/src/main/res/layout-xlarge/cpp_app_editor.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/cpp_app_keyboard.xml b/app/src/main/res/layout-xlarge/cpp_app_keyboard.xml deleted file mode 100644 index 886eb429..00000000 --- a/app/src/main/res/layout-xlarge/cpp_app_keyboard.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/main_calculator.xml b/app/src/main/res/layout-xlarge/main_calculator.xml deleted file mode 100644 index 8651bc38..00000000 --- a/app/src/main/res/layout-xlarge/main_calculator.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/cpp_plot_fragment.xml b/app/src/main/res/layout/cpp_plot_fragment.xml index ed94cacb..db473f00 100644 --- a/app/src/main/res/layout/cpp_plot_fragment.xml +++ b/app/src/main/res/layout/cpp_plot_fragment.xml @@ -29,12 +29,6 @@ a:layout_width="match_parent" a:layout_height="match_parent"> - - diff --git a/app/src/main/res/layout/cpp_plotter_fragment.xml b/app/src/main/res/layout/cpp_plotter_fragment.xml index 71a1b513..07ee94fc 100644 --- a/app/src/main/res/layout/cpp_plotter_fragment.xml +++ b/app/src/main/res/layout/cpp_plotter_fragment.xml @@ -29,12 +29,6 @@ a:layout_width="match_parent" a:layout_height="match_parent"> - - - - - - - - - - - - - - - - - - - - - - - -