Fragments

This commit is contained in:
serso 2016-02-05 21:52:36 +01:00
parent 9d9da8a608
commit 05024841e7
27 changed files with 356 additions and 680 deletions

View File

@ -1,5 +1,6 @@
package org.solovyev.android.calculator; package org.solovyev.android.calculator;
import dagger.Component;
import org.solovyev.android.calculator.errors.FixableErrorFragment; import org.solovyev.android.calculator.errors.FixableErrorFragment;
import org.solovyev.android.calculator.errors.FixableErrorsActivity; import org.solovyev.android.calculator.errors.FixableErrorsActivity;
import org.solovyev.android.calculator.functions.EditFunctionFragment; import org.solovyev.android.calculator.functions.EditFunctionFragment;
@ -13,8 +14,6 @@ import org.solovyev.android.calculator.variables.VariablesFragment;
import javax.inject.Singleton; import javax.inject.Singleton;
import dagger.Component;
@Singleton @Singleton
@Component(modules = AppModule.class) @Component(modules = AppModule.class)
public interface AppComponent { public interface AppComponent {
@ -34,4 +33,6 @@ public interface AppComponent {
void inject(CalculatorActivity activity); void inject(CalculatorActivity activity);
void inject(FixableErrorsActivity activity); void inject(FixableErrorsActivity activity);
void inject(CalculatorReceiver receiver); void inject(CalculatorReceiver receiver);
void inject(DisplayFragment fragment);
void inject(KeyboardFragment fragment);
} }

View File

@ -12,20 +12,24 @@ import static org.solovyev.android.calculator.App.cast;
public abstract class BaseFragment extends Fragment { public abstract class BaseFragment extends Fragment {
@Nonnull protected FragmentUi ui;
protected final FragmentUi ui;
public BaseFragment(@Nonnull CalculatorFragmentType type) {
ui = new FragmentUi(type.getDefaultLayoutId(), type.getDefaultTitleResId(), false);
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
inject(cast(getActivity().getApplication()).getComponent()); inject(cast(getActivity().getApplication()).getComponent());
ui = createUi();
ui.onCreate(this); ui.onCreate(this);
} }
@Nonnull
protected abstract FragmentUi createUi();
@Nonnull
protected final FragmentUi createUi(@Nonnull CalculatorFragmentType type) {
return new FragmentUi(type.getDefaultLayoutId(), type.getDefaultTitleResId(), false);
}
protected void inject(@Nonnull AppComponent component) { protected void inject(@Nonnull AppComponent component) {
} }

View File

@ -174,8 +174,8 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference
} }
FragmentUtils.createFragment(this, EditorFragment.class, R.id.editorContainer, "editor"); FragmentUtils.createFragment(this, EditorFragment.class, R.id.editorContainer, "editor");
FragmentUtils.createFragment(this, CalculatorDisplayFragment.class, R.id.displayContainer, "display"); FragmentUtils.createFragment(this, DisplayFragment.class, R.id.displayContainer, "display");
FragmentUtils.createFragment(this, CalculatorKeyboardFragment.class, R.id.keyboardContainer, "keyboard"); FragmentUtils.createFragment(this, KeyboardFragment.class, R.id.keyboardContainer, "keyboard");
this.useBackAsPrev = Preferences.Gui.usePrevAsBack.getPreference(preferences); this.useBackAsPrev = Preferences.Gui.usePrevAsBack.getPreference(preferences);
if (savedInstanceState == null) { if (savedInstanceState == null) {

View File

@ -1,109 +0,0 @@
/*
* 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.calculator;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.annotation.Nonnull;
/**
* User: Solovyev_S
* Date: 25.09.12
* Time: 12:03
*/
public class CalculatorDisplayFragment extends Fragment {
@Nonnull
private FragmentUi fragmentUi;
@Nonnull
private DisplayView displayView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(prefs);
if (!layout.optimized) {
fragmentUi = new FragmentUi(R.layout.cpp_app_display_mobile, R.string.result);
} else {
fragmentUi = new FragmentUi(R.layout.cpp_app_display, R.string.result);
}
fragmentUi.onCreate(this);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return fragmentUi.onCreateView(this, inflater, container);
}
@Override
public void onViewCreated(View root, Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState);
displayView = (DisplayView) root.findViewById(R.id.calculator_display);
App.getDisplay().setView(displayView);
fragmentUi.onViewCreated(this, root);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
@Override
public void onResume() {
super.onResume();
fragmentUi.onResume(this);
}
@Override
public void onPause() {
fragmentUi.onPause(this);
super.onPause();
}
@Override
public void onDestroyView() {
App.getDisplay().clearView(displayView);
fragmentUi.onDestroyView(this);
super.onDestroyView();
}
@Override
public void onDestroy() {
fragmentUi.onDestroy(this);
super.onDestroy();
}
}

View File

@ -1,114 +0,0 @@
/*
* 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.calculator;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.annotation.Nonnull;
/**
* User: Solovyev_S
* Date: 03.10.12
* Time: 14:18
*/
public abstract class CalculatorFragment extends Fragment {
@Nonnull
private final FragmentUi fragmentUi;
protected CalculatorFragment(int layoutResId, int titleResId) {
fragmentUi = new FragmentUi(layoutResId, titleResId);
}
protected CalculatorFragment(@Nonnull CalculatorFragmentType fragmentType) {
fragmentUi = new FragmentUi(fragmentType.getDefaultLayoutId(), fragmentType.getDefaultTitleResId());
}
protected CalculatorFragment(@Nonnull FragmentUi fragmentUi) {
this.fragmentUi = fragmentUi;
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
fragmentUi.onCreate(this);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return fragmentUi.onCreateView(this, inflater, container);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
fragmentUi.onViewCreated(this, view);
}
@Override
public void onResume() {
super.onResume();
this.fragmentUi.onResume(this);
}
@Override
public void onPause() {
this.fragmentUi.onPause(this);
super.onPause();
}
@Override
public void onDestroyView() {
fragmentUi.onDestroyView(this);
super.onDestroyView();
}
@Override
public void onDestroy() {
fragmentUi.onDestroy(this);
super.onDestroy();
}
@Override
public void onDetach() {
super.onDetach();
}
public boolean isPaneFragment() {
return fragmentUi.isPane(this);
}
}

View File

@ -24,14 +24,14 @@ package org.solovyev.android.calculator;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import org.solovyev.android.calculator.about.CalculatorAboutFragment; import org.solovyev.android.calculator.about.AboutFragment;
import org.solovyev.android.calculator.about.CalculatorReleaseNotesFragment; import org.solovyev.android.calculator.about.ReleaseNotesFragment;
import org.solovyev.android.calculator.history.RecentHistoryFragment; import org.solovyev.android.calculator.history.RecentHistoryFragment;
import org.solovyev.android.calculator.history.SavedHistoryFragment; import org.solovyev.android.calculator.history.SavedHistoryFragment;
import org.solovyev.android.calculator.functions.FunctionsFragment; import org.solovyev.android.calculator.functions.FunctionsFragment;
import org.solovyev.android.calculator.operators.OperatorsFragment; import org.solovyev.android.calculator.operators.OperatorsFragment;
import org.solovyev.android.calculator.variables.VariablesFragment; import org.solovyev.android.calculator.variables.VariablesFragment;
import org.solovyev.android.calculator.matrix.CalculatorMatrixEditFragment; import org.solovyev.android.calculator.matrix.EditMatrixFragment;
import org.solovyev.android.calculator.preferences.PurchaseDialogActivity; import org.solovyev.android.calculator.preferences.PurchaseDialogActivity;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@ -54,11 +54,11 @@ public enum CalculatorFragmentType {
purchase_dialog(PurchaseDialogActivity.PurchaseDialogFragment.class, R.layout.cpp_purchase_dialog_fragment, R.string.cpp_purchase_title), purchase_dialog(PurchaseDialogActivity.PurchaseDialogFragment.class, R.layout.cpp_purchase_dialog_fragment, R.string.cpp_purchase_title),
about(CalculatorAboutFragment.class, R.layout.about_fragment, R.string.c_about), about(AboutFragment.class, R.layout.about_fragment, R.string.c_about),
// todo serso: strings // todo serso: strings
matrix_edit(CalculatorMatrixEditFragment.class, R.layout.matrix_edit_fragment, R.string.c_release_notes), matrix_edit(EditMatrixFragment.class, R.layout.matrix_edit_fragment, R.string.c_release_notes),
release_notes(CalculatorReleaseNotesFragment.class, R.layout.release_notes_fragment, R.string.c_release_notes); release_notes(ReleaseNotesFragment.class, R.layout.release_notes_fragment, R.string.c_release_notes);
private final int defaultLayoutId; private final int defaultLayoutId;
@Nonnull @Nonnull

View File

@ -1,109 +0,0 @@
/*
* 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.calculator;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.annotation.Nonnull;
/**
* User: Solovyev_S
* Date: 03.10.12
* Time: 14:18
*/
public abstract class CalculatorListFragment extends ListFragment {
@Nonnull
private final FragmentUi ui;
protected CalculatorListFragment(int layoutResId, int titleResId) {
ui = new FragmentUi(layoutResId, titleResId);
}
protected CalculatorListFragment(@Nonnull CalculatorFragmentType fragmentType) {
ui = new FragmentUi(fragmentType.getDefaultLayoutId(), fragmentType.getDefaultTitleResId());
}
protected CalculatorListFragment(@Nonnull FragmentUi ui) {
this.ui = ui;
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ui.onCreate(this);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return ui.onCreateView(this, inflater, container);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ui.onViewCreated(this, view);
}
@Override
public void onResume() {
super.onResume();
this.ui.onResume(this);
}
@Override
public void onPause() {
this.ui.onPause(this);
super.onPause();
}
@Override
public void onDestroyView() {
ui.onDestroyView(this);
super.onDestroyView();
}
@Override
public void onDestroy() {
ui.onDestroy(this);
super.onDestroy();
}
@Override
public void onDetach() {
super.onDetach();
}
}

View File

@ -0,0 +1,75 @@
/*
* 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.calculator;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.Bind;
import butterknife.ButterKnife;
import javax.annotation.Nonnull;
import javax.inject.Inject;
public class DisplayFragment extends BaseFragment {
@Bind(R.id.calculator_display)
DisplayView displayView;
@Inject
SharedPreferences preferences;
@Inject
Display display;
@Override
protected void inject(@Nonnull AppComponent component) {
super.inject(component);
component.inject(this);
}
@Nonnull
@Override
protected FragmentUi createUi() {
final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(preferences);
if (!layout.optimized) {
return new FragmentUi(R.layout.cpp_app_display_mobile, R.string.result);
} else {
return new FragmentUi(R.layout.cpp_app_display, R.string.result);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = super.onCreateView(inflater, container, savedInstanceState);
ButterKnife.bind(this, view);
display.setView(displayView);
return view;
}
@Override
public void onDestroyView() {
display.clearView(displayView);
super.onDestroyView();
}
}

View File

@ -22,28 +22,17 @@
package org.solovyev.android.calculator; package org.solovyev.android.calculator;
import android.app.Activity;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.view.*;
import android.view.LayoutInflater; import butterknife.Bind;
import android.view.Menu; import butterknife.ButterKnife;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import org.solovyev.android.calculator.view.NumeralBaseConverterDialog; import org.solovyev.android.calculator.view.NumeralBaseConverterDialog;
import javax.annotation.Nonnull;
import javax.inject.Inject; import javax.inject.Inject;
import static org.solovyev.android.calculator.App.cast; public class EditorFragment extends BaseFragment {
public class EditorFragment extends Fragment {
private FragmentUi ui;
private EditorView editorView;
@Inject @Inject
Editor editor; Editor editor;
@ -51,57 +40,38 @@ public class EditorFragment extends Fragment {
SharedPreferences preferences; SharedPreferences preferences;
@Inject @Inject
ActivityLauncher launcher; ActivityLauncher launcher;
@Bind(R.id.calculator_editor)
public EditorFragment() { EditorView editorView;
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
cast(getActivity().getApplication()).getComponent().inject(this);
final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(preferences);
if (!layout.optimized) {
ui = new FragmentUi(R.layout.cpp_app_editor_mobile, R.string.editor);
} else {
ui = new FragmentUi(R.layout.cpp_app_editor, R.string.editor);
}
ui.onCreate(this);
setHasOptionsMenu(true); setHasOptionsMenu(true);
} }
@Override @Override
public void onViewCreated(View view, Bundle savedInstanceState) { protected void inject(@Nonnull AppComponent component) {
super.onViewCreated(view, savedInstanceState); super.inject(component);
component.inject(this);
}
ui.onViewCreated(this, view); @Nonnull
@Override
editorView = (EditorView) view.findViewById(R.id.calculator_editor); protected FragmentUi createUi() {
editor.setView(editorView); final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(preferences);
if (!layout.optimized) {
return new FragmentUi(R.layout.cpp_app_editor_mobile, R.string.editor);
} else {
return new FragmentUi(R.layout.cpp_app_editor, R.string.editor);
}
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return ui.onCreateView(this, inflater, container); final View view = super.onCreateView(inflater, container, savedInstanceState);
} ButterKnife.bind(this, view);
editor.setView(editorView);
@Override return view;
public void onResume() {
super.onResume();
this.ui.onResume(this);
}
@Override
public void onPause() {
this.ui.onPause(this);
super.onPause();
} }
@Override @Override
@ -111,17 +81,6 @@ public class EditorFragment extends Fragment {
super.onDestroyView(); super.onDestroyView();
} }
@Override
public void onDestroy() {
ui.onDestroy(this);
super.onDestroy();
}
@Override
public void onDetach() {
super.onDetach();
}
@Override @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.main, menu); inflater.inflate(R.menu.main, menu);

View File

@ -144,7 +144,7 @@ public class FragmentUi extends BaseUi {
adView = (AdView) root.findViewById(R.id.ad); adView = (AdView) root.findViewById(R.id.ad);
final ViewGroup mainFragmentLayout = (ViewGroup) root.findViewById(R.id.main_fragment_layout); final ViewGroup mainFragmentLayout = (ViewGroup) root.findViewById(R.id.main_fragment_layout);
if (fragment instanceof CalculatorDisplayFragment || fragment instanceof EditorFragment || fragment instanceof CalculatorKeyboardFragment) { if (fragment instanceof DisplayFragment || fragment instanceof EditorFragment || fragment instanceof KeyboardFragment) {
// no ads in those fragments // no ads in those fragments
} else { } else {
if (adView != null) { if (adView != null) {
@ -153,7 +153,7 @@ public class FragmentUi extends BaseUi {
} }
} }
if (fragment instanceof CalculatorKeyboardFragment) { if (fragment instanceof KeyboardFragment) {
processButtons(fragment.getActivity(), root); processButtons(fragment.getActivity(), root);
} }
fixFonts(root); fixFonts(root);

View File

@ -24,89 +24,68 @@ package org.solovyev.android.calculator;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import butterknife.Bind;
import butterknife.ButterKnife;
import org.solovyev.android.calculator.buttons.CppButtons; import org.solovyev.android.calculator.buttons.CppButtons;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import static org.solovyev.android.calculator.Engine.Preferences.multiplicationSign;
import static org.solovyev.android.calculator.Engine.Preferences.numeralBase;
import static org.solovyev.android.calculator.NumeralBaseButtons.toggleNumericDigits; import static org.solovyev.android.calculator.NumeralBaseButtons.toggleNumericDigits;
import static org.solovyev.android.calculator.Preferences.Gui.hideNumeralBaseDigits; import static org.solovyev.android.calculator.Preferences.Gui.hideNumeralBaseDigits;
import static org.solovyev.android.calculator.Preferences.Gui.showEqualsButton; import static org.solovyev.android.calculator.Preferences.Gui.showEqualsButton;
import static org.solovyev.android.calculator.Engine.Preferences.multiplicationSign;
import static org.solovyev.android.calculator.Engine.Preferences.numeralBase;
/** public class KeyboardFragment extends BaseFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
* User: Solovyev_S
* Date: 25.09.12
* Time: 12:25
*/
public class CalculatorKeyboardFragment extends Fragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Nonnull @Inject
private FragmentUi ui; SharedPreferences preferences;
@Bind(R.id.cpp_button_multiplication)
Button multiplicationButton;
@Nullable
@Bind(R.id.cpp_button_equals)
Button equalsButton;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
final SharedPreferences preferences = App.getPreferences();
final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(preferences);
if (!layout.optimized) {
ui = new FragmentUi(R.layout.cpp_app_keyboard_mobile);
} else {
ui = new FragmentUi(R.layout.cpp_app_keyboard);
}
ui.onCreate(this);
preferences.registerOnSharedPreferenceChangeListener(this); preferences.registerOnSharedPreferenceChangeListener(this);
} }
@Override
protected void inject(@Nonnull AppComponent component) {
super.inject(component);
component.inject(this);
}
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return ui.onCreateView(this, inflater, container); final View view = super.onCreateView(inflater, container, savedInstanceState);
ButterKnife.bind(this, view);
return view;
} }
@Nonnull
@Override @Override
public void onViewCreated(View root, Bundle savedInstanceState) { protected FragmentUi createUi() {
super.onViewCreated(root, savedInstanceState); final Preferences.Gui.Layout layout = Preferences.Gui.getLayout(preferences);
ui.onViewCreated(this, root); if (!layout.optimized) {
return new FragmentUi(R.layout.cpp_app_keyboard_mobile);
} else {
return new FragmentUi(R.layout.cpp_app_keyboard);
} }
@Override
public void onResume() {
super.onResume();
this.ui.onResume(this);
}
@Override
public void onPause() {
this.ui.onPause(this);
super.onPause();
}
@Override
public void onDestroyView() {
ui.onDestroyView(this);
super.onDestroyView();
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
preferences.unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy(); super.onDestroy();
ui.onDestroy(this);
App.getPreferences().unregisterOnSharedPreferenceChangeListener(this);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
} }
@Override @Override
@ -115,12 +94,12 @@ public class CalculatorKeyboardFragment extends Fragment implements SharedPrefer
toggleNumericDigits(this.getActivity(), preferences); toggleNumericDigits(this.getActivity(), preferences);
} }
if (showEqualsButton.isSameKey(key)) { if (equalsButton != null && showEqualsButton.isSameKey(key)) {
CppButtons.toggleEqualsButton(preferences, this.getActivity()); CppButtons.toggleEqualsButton(preferences, getActivity(), equalsButton);
} }
if (multiplicationSign.isSameKey(key)) { if (multiplicationSign.isSameKey(key)) {
CppButtons.initMultiplicationButton(getView()); multiplicationButton.setText(Engine.Preferences.multiplicationSign.getPreference(preferences));
} }
} }
} }

View File

@ -32,11 +32,6 @@ import static jscl.NumeralBase.hex;
import static org.solovyev.android.calculator.Engine.Preferences.numeralBase; import static org.solovyev.android.calculator.Engine.Preferences.numeralBase;
import static org.solovyev.android.calculator.Preferences.Gui.hideNumeralBaseDigits; import static org.solovyev.android.calculator.Preferences.Gui.hideNumeralBaseDigits;
/**
* User: serso
* Date: 4/20/12
* Time: 5:03 PM
*/
public class NumeralBaseButtons { public class NumeralBaseButtons {
public static void toggleNumericDigits(@Nonnull Activity activity, @Nonnull NumeralBase currentNumeralBase) { public static void toggleNumericDigits(@Nonnull Activity activity, @Nonnull NumeralBase currentNumeralBase) {

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.calculator.about;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.Bind;
import butterknife.ButterKnife;
import org.solovyev.android.calculator.BaseFragment;
import org.solovyev.android.calculator.FragmentUi;
import org.solovyev.android.calculator.R;
import javax.annotation.Nonnull;
import static android.view.View.GONE;
import static org.solovyev.android.calculator.CalculatorFragmentType.about;
import static org.solovyev.common.text.Strings.isEmpty;
public class AboutFragment extends BaseFragment {
@Bind(R.id.about_image)
ImageView imageView;
@Bind(R.id.about_text)
TextView textView;
@Bind(R.id.about_translators_label)
TextView translatorsLabel;
@Bind(R.id.about_translators)
TextView translatorsView;
@Nonnull
@Override
protected FragmentUi createUi() {
return createUi(about);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = super.onCreateView(inflater, container, savedInstanceState);
ButterKnife.bind(this, view);
if (ui.getTheme().light) {
imageView.setImageResource(R.drawable.logo_wizard_light);
}
textView.setMovementMethod(LinkMovementMethod.getInstance());
if (isEmpty(translatorsView.getText())) {
translatorsLabel.setVisibility(GONE);
translatorsView.setVisibility(GONE);
}
return view;
}
}

View File

@ -1,69 +0,0 @@
/*
* 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.calculator.about;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import org.solovyev.android.calculator.App;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;
import static android.view.View.GONE;
import static org.solovyev.common.text.Strings.isEmpty;
/**
* User: serso
* Date: 12/24/11
* Time: 11:55 PM
*/
public class CalculatorAboutFragment extends CalculatorFragment {
public CalculatorAboutFragment() {
super(CalculatorFragmentType.about);
}
@Override
public void onViewCreated(View root, Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState);
if (App.getTheme().light) {
final ImageView image = (ImageView) root.findViewById(R.id.about_image);
image.setImageResource(R.drawable.logo_wizard_light);
}
final TextView aboutTextView = (TextView) root.findViewById(R.id.cpp_about_textview);
aboutTextView.setMovementMethod(LinkMovementMethod.getInstance());
final TextView translatorsTextTextView = (TextView) root.findViewById(R.id.cpp_about_translators_text);
final TextView translatorsTextView = (TextView) root.findViewById(R.id.cpp_about_translators);
if (isEmpty(translatorsTextView.getText())) {
translatorsTextTextView.setVisibility(GONE);
translatorsTextView.setVisibility(GONE);
}
}
}

View File

@ -25,32 +25,38 @@ package org.solovyev.android.calculator.about;
import android.os.Bundle; import android.os.Bundle;
import android.text.Html; import android.text.Html;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import butterknife.Bind;
import org.solovyev.android.calculator.CalculatorFragment; import butterknife.ButterKnife;
import org.solovyev.android.calculator.CalculatorFragmentType; import org.solovyev.android.calculator.BaseFragment;
import org.solovyev.android.calculator.FragmentUi;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.release.ReleaseNotes; import org.solovyev.android.calculator.release.ReleaseNotes;
/** import javax.annotation.Nonnull;
* User: serso
* Date: 12/25/11
* Time: 12:00 AM
*/
public class CalculatorReleaseNotesFragment extends CalculatorFragment {
public CalculatorReleaseNotesFragment() { import static org.solovyev.android.calculator.CalculatorFragmentType.release_notes;
super(CalculatorFragmentType.release_notes);
public class ReleaseNotesFragment extends BaseFragment {
@Bind(R.id.releasenotes_text)
TextView text;
@Nonnull
@Override
protected FragmentUi createUi() {
return createUi(release_notes);
} }
@Override @Override
public void onViewCreated(View root, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState); final View view = super.onCreateView(inflater, container, savedInstanceState);
ButterKnife.bind(this, view);
final TextView releaseNotes = (TextView) root.findViewById(R.id.releaseNotesTextView); text.setMovementMethod(LinkMovementMethod.getInstance());
releaseNotes.setMovementMethod(LinkMovementMethod.getInstance()); text.setText(Html.fromHtml(ReleaseNotes.getReleaseNotes(getActivity())));
return view;
releaseNotes.setText(Html.fromHtml(ReleaseNotes.getReleaseNotes(this.getActivity())));
} }
} }

View File

@ -33,17 +33,10 @@ import android.util.TypedValue;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import jscl.AngleUnit;
import jscl.NumeralBase;
import org.solovyev.android.Views; import org.solovyev.android.Views;
import org.solovyev.android.calculator.App; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.CalculatorEventType;
import org.solovyev.android.calculator.DigitButtonDragProcessor;
import org.solovyev.android.calculator.Engine;
import org.solovyev.android.calculator.Keyboard;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.Preferences;
import org.solovyev.android.calculator.PreferredPreferences;
import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.view.AngleUnitsButton; import org.solovyev.android.calculator.view.AngleUnitsButton;
import org.solovyev.android.calculator.view.NumeralBasesButton; import org.solovyev.android.calculator.view.NumeralBasesButton;
import org.solovyev.android.calculator.view.ScreenMetrics; import org.solovyev.android.calculator.view.ScreenMetrics;
@ -54,9 +47,6 @@ import org.solovyev.android.views.dragbutton.SimpleDragListener;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import jscl.AngleUnit;
import jscl.NumeralBase;
public final class CppButtons { public final class CppButtons {
private CppButtons() { private CppButtons() {
@ -95,22 +85,27 @@ public final class CppButtons {
public static void toggleEqualsButton(@Nullable SharedPreferences preferences, public static void toggleEqualsButton(@Nullable SharedPreferences preferences,
@Nonnull Activity activity) { @Nonnull Activity activity) {
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences; preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
final boolean large = App.isLargeScreen() && Preferences.Gui.getLayout(preferences).optimized;
if (!large) {
if (Views.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT
|| !Preferences.Gui.autoOrientation.getPreference(preferences)) {
final DragButton equalsButton = (DragButton) activity.findViewById(R.id.cpp_button_equals); final DragButton equalsButton = (DragButton) activity.findViewById(R.id.cpp_button_equals);
if (equalsButton != null) { if(equalsButton == null) {
return;
}
toggleEqualsButton(preferences, activity, equalsButton);
}
public static void toggleEqualsButton(@Nonnull SharedPreferences preferences, @Nonnull Activity activity, @Nonnull Button button) {
final boolean large = App.isLargeScreen() && Preferences.Gui.getLayout(preferences).optimized;
if (large) {
return;
}
if (Views.getScreenOrientation(activity) != Configuration.ORIENTATION_PORTRAIT && Preferences.Gui.autoOrientation.getPreference(preferences)) {
return;
}
if (Preferences.Gui.showEqualsButton.getPreference(preferences)) { if (Preferences.Gui.showEqualsButton.getPreference(preferences)) {
equalsButton.setVisibility(View.VISIBLE); button.setVisibility(View.VISIBLE);
} else { } else {
equalsButton.setVisibility(View.GONE); button.setVisibility(View.GONE);
}
}
}
} }
} }

View File

@ -71,10 +71,6 @@ public abstract class BaseEntitiesFragment<E extends MathEntity> extends BaseFra
@Nullable @Nullable
private String category; private String category;
protected BaseEntitiesFragment(@Nonnull CalculatorFragmentType type) {
super(type);
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);

View File

@ -43,6 +43,8 @@ import javax.inject.Inject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.solovyev.android.calculator.CalculatorFragmentType.functions;
public class FunctionsFragment extends BaseEntitiesFragment<Function> { public class FunctionsFragment extends BaseEntitiesFragment<Function> {
@Inject @Inject
@ -52,8 +54,10 @@ public class FunctionsFragment extends BaseEntitiesFragment<Function> {
@Inject @Inject
Bus bus; Bus bus;
public FunctionsFragment() { @Nonnull
super(CalculatorFragmentType.functions); @Override
protected FragmentUi createUi() {
return createUi(functions);
} }
@Override @Override

View File

@ -69,7 +69,6 @@ public abstract class BaseHistoryFragment extends BaseFragment {
private HistoryAdapter adapter; private HistoryAdapter adapter;
protected BaseHistoryFragment(@Nonnull CalculatorFragmentType type) { protected BaseHistoryFragment(@Nonnull CalculatorFragmentType type) {
super(type);
recentHistory = type == CalculatorFragmentType.history; recentHistory = type == CalculatorFragmentType.history;
} }

View File

@ -22,19 +22,20 @@
package org.solovyev.android.calculator.history; package org.solovyev.android.calculator.history;
import android.view.ContextMenu;
import android.view.MenuItem;
import org.solovyev.android.calculator.CalculatorFragmentType; import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.FragmentUi;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.List;
import static android.view.Menu.NONE;
public class RecentHistoryFragment extends BaseHistoryFragment { public class RecentHistoryFragment extends BaseHistoryFragment {
public RecentHistoryFragment() { public RecentHistoryFragment() {
super(CalculatorFragmentType.history); super(CalculatorFragmentType.history);
} }
@Nonnull
@Override
protected FragmentUi createUi() {
return createUi(CalculatorFragmentType.history);
}
} }

View File

@ -22,11 +22,21 @@
package org.solovyev.android.calculator.history; package org.solovyev.android.calculator.history;
import org.solovyev.android.calculator.CalculatorFragmentType; import org.solovyev.android.calculator.FragmentUi;
import javax.annotation.Nonnull;
import static org.solovyev.android.calculator.CalculatorFragmentType.saved_history;
public class SavedHistoryFragment extends BaseHistoryFragment { public class SavedHistoryFragment extends BaseHistoryFragment {
public SavedHistoryFragment() { public SavedHistoryFragment() {
super(CalculatorFragmentType.saved_history); super(saved_history);
}
@Nonnull
@Override
protected FragmentUi createUi() {
return createUi(saved_history);
} }
} }

View File

@ -25,30 +25,16 @@ package org.solovyev.android.calculator.matrix;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import org.solovyev.android.calculator.CalculatorFragment; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;
import org.solovyev.android.view.IntegerRange; import org.solovyev.android.view.IntegerRange;
import org.solovyev.android.view.Picker; import org.solovyev.android.view.Picker;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
/** import static org.solovyev.android.calculator.CalculatorFragmentType.matrix_edit;
* User: Solovyev_S
* Date: 12.10.12
* Time: 10:41
*/
public class CalculatorMatrixEditFragment extends CalculatorFragment implements Picker.OnChangedListener<Integer> {
/*
**********************************************************************
*
* CONSTANTS
*
**********************************************************************
*/
public class EditMatrixFragment extends BaseFragment implements Picker.OnChangedListener<Integer> {
private static final int MAX_COUNT = 10; private static final int MAX_COUNT = 10;
private static final int MIN_COUNT = 2; private static final int MIN_COUNT = 2;
private static final int DEFAULT_ROWS = 2; private static final int DEFAULT_ROWS = 2;
@ -56,29 +42,15 @@ public class CalculatorMatrixEditFragment extends CalculatorFragment implements
private static final String MATRIX = "matrix"; private static final String MATRIX = "matrix";
public EditMatrixFragment() {
/*
**********************************************************************
*
* CONSTRUCTORS
*
**********************************************************************
*/
public CalculatorMatrixEditFragment() {
super(CalculatorFragmentType.matrix_edit);
setRetainInstance(true); setRetainInstance(true);
} }
/* @Nonnull
********************************************************************** @Override
* protected FragmentUi createUi() {
* METHODS return createUi(matrix_edit);
* }
**********************************************************************
*/
@Override @Override
public void onViewCreated(View root, @Nullable Bundle in) { public void onViewCreated(View root, @Nullable Bundle in) {
@ -143,5 +115,4 @@ public class CalculatorMatrixEditFragment extends CalculatorFragment implements
private void onRowsCountChange(@Nonnull Integer newRows) { private void onRowsCountChange(@Nonnull Integer newRows) {
getMatrixView(getView()).setMatrixRows(newRows); getMatrixView(getView()).setMatrixRows(newRows);
} }
} }

View File

@ -37,6 +37,8 @@ import javax.inject.Inject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.solovyev.android.calculator.CalculatorFragmentType.operators;
public class OperatorsFragment extends BaseEntitiesFragment<Operator> { public class OperatorsFragment extends BaseEntitiesFragment<Operator> {
@Inject @Inject
@ -44,8 +46,10 @@ public class OperatorsFragment extends BaseEntitiesFragment<Operator> {
@Inject @Inject
PostfixFunctionsRegistry postfixFunctionsRegistry; PostfixFunctionsRegistry postfixFunctionsRegistry;
public OperatorsFragment() { @Nonnull
super(CalculatorFragmentType.operators); @Override
protected FragmentUi createUi() {
return createUi(operators);
} }
@Override @Override

View File

@ -26,15 +26,14 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.method.ScrollingMovementMethod; import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import org.solovyev.android.calculator.ActivityUi; import butterknife.Bind;
import org.solovyev.android.calculator.App; import butterknife.ButterKnife;
import org.solovyev.android.calculator.BaseActivity; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;
import org.solovyev.android.checkout.ActivityCheckout; import org.solovyev.android.checkout.ActivityCheckout;
import org.solovyev.android.checkout.BillingRequests; import org.solovyev.android.checkout.BillingRequests;
import org.solovyev.android.checkout.Checkout; import org.solovyev.android.checkout.Checkout;
@ -46,11 +45,8 @@ import org.solovyev.android.fragments.FragmentUtils;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
/** import static org.solovyev.android.calculator.CalculatorFragmentType.purchase_dialog;
* User: serso
* Date: 1/20/13
* Time: 2:36 PM
*/
public class PurchaseDialogActivity extends BaseActivity { public class PurchaseDialogActivity extends BaseActivity {
@Nonnull @Nonnull
@ -117,18 +113,25 @@ public class PurchaseDialogActivity extends BaseActivity {
super.onDestroy(); super.onDestroy();
} }
public static class PurchaseDialogFragment extends CalculatorFragment { public static class PurchaseDialogFragment extends BaseFragment {
public PurchaseDialogFragment() { @Bind(R.id.cpp_purchase_text)
super(CalculatorFragmentType.purchase_dialog); TextView purchaseText;
@Bind(R.id.cpp_continue_button)
View continueButton;
@Nonnull
@Override
protected FragmentUi createUi() {
return createUi(purchase_dialog);
} }
@Override @Override
public void onViewCreated(@Nonnull View root, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState); final View view = super.onCreateView(inflater, container, savedInstanceState);
ButterKnife.bind(this, view);
((TextView) root.findViewById(R.id.cpp_purchase_text)).setMovementMethod(ScrollingMovementMethod.getInstance()); purchaseText.setMovementMethod(ScrollingMovementMethod.getInstance());
root.findViewById(R.id.cpp_continue_button).setOnClickListener(new View.OnClickListener() { continueButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final Activity activity = getActivity(); final Activity activity = getActivity();
@ -137,6 +140,7 @@ public class PurchaseDialogActivity extends BaseActivity {
} }
} }
}); });
return view;
} }
} }
} }

View File

@ -46,6 +46,8 @@ import javax.inject.Inject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.solovyev.android.calculator.CalculatorFragmentType.variables;
public class VariablesFragment extends BaseEntitiesFragment<IConstant> { public class VariablesFragment extends BaseEntitiesFragment<IConstant> {
@Inject @Inject
@ -55,8 +57,10 @@ public class VariablesFragment extends BaseEntitiesFragment<IConstant> {
@Inject @Inject
Bus bus; Bus bus;
public VariablesFragment() { @Nonnull
super(CalculatorFragmentType.variables); @Override
protected FragmentUi createUi() {
return createUi(variables);
} }
public static boolean isValidValue(@Nonnull String value) { public static boolean isValidValue(@Nonnull String value) {

View File

@ -48,7 +48,7 @@
a:orientation="vertical"> a:orientation="vertical">
<TextView <TextView
a:id="@+id/cpp_about_textview" a:id="@+id/about_text"
style="@style/CppText.About" style="@style/CppText.About"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="match_parent" a:layout_height="match_parent"
@ -56,7 +56,7 @@
<TextView <TextView
a:id="@+id/cpp_about_translators_text" a:id="@+id/about_translators_label"
style="@style/CppText.About" style="@style/CppText.About"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="wrap_content" a:layout_height="wrap_content"
@ -64,7 +64,7 @@
a:text="@string/cpp_translators_text" /> a:text="@string/cpp_translators_text" />
<TextView <TextView
a:id="@+id/cpp_about_translators" a:id="@+id/about_translators"
style="@style/CppText.About" style="@style/CppText.About"
a:layout_width="match_parent" a:layout_width="match_parent"
a:layout_height="wrap_content" a:layout_height="wrap_content"

View File

@ -23,21 +23,15 @@
--> -->
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="fill_parent" a:layout_width="match_parent"
a:layout_height="fill_parent" a:layout_height="match_parent"
a:orientation="vertical"> a:orientation="vertical">
<TextView <TextView
a:id="@+id/releaseNotesTextView" a:id="@+id/releasenotes_text"
style="@style/CppText.About" style="@style/CppText.About"
a:layout_width="fill_parent" a:layout_width="match_parent"
a:layout_height="fill_parent" a:layout_height="match_parent"
a:layout_weight="1"
a:gravity="top|left"
a:scrollbars="vertical" /> a:scrollbars="vertical" />
<!--
a:scrollbarFadeDuration="0" is not support in android_1.6_compatibility
-->
</LinearLayout> </LinearLayout>