From d104e0a6eb44c18c34f4869e69cf8994f8e4d595 Mon Sep 17 00:00:00 2001 From: Norbert Nagold Date: Thu, 7 Jun 2012 11:58:44 +0200 Subject: [PATCH] remove unneeded files --- AndroidManifest.xml | 3 - src/com/ichi2/anki/CramDeckActivity.java | 86 -------- src/com/ichi2/anki/CramDeckFragment.java | 268 ----------------------- 3 files changed, 357 deletions(-) delete mode 100644 src/com/ichi2/anki/CramDeckActivity.java delete mode 100644 src/com/ichi2/anki/CramDeckFragment.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fe192b381d..2dd7f78eec 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -48,9 +48,6 @@ - diff --git a/src/com/ichi2/anki/CramDeckActivity.java b/src/com/ichi2/anki/CramDeckActivity.java deleted file mode 100644 index 8a52ca21f7..0000000000 --- a/src/com/ichi2/anki/CramDeckActivity.java +++ /dev/null @@ -1,86 +0,0 @@ -///*************************************************************************************** -// * Copyright (c) 2012 Norbert Nagold * -// * * -// * This program is free software; you can redistribute it and/or modify it under * -// * the terms of the GNU General Public License as published by the Free Software * -// * Foundation; either version 3 of the License, or (at your option) any later * -// * version. * -// * * -// * This program is distributed in the hope that it will be useful, but WITHOUT ANY * -// * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * -// * PARTICULAR PURPOSE. See the GNU General Public License for more details. * -// * * -// * You should have received a copy of the GNU General Public License along with * -// * this program. If not, see . * -// ****************************************************************************************/ -// -//package com.ichi2.anki; -//import com.ichi2.anki2.R; -// -//import com.ichi2.anim.ActivityTransitionAnimation; -// -//import android.os.Bundle; -//import android.support.v4.app.Fragment; -//import android.support.v4.app.FragmentActivity; -//import android.util.Log; -//import android.view.KeyEvent; -// -//public class CramDeckActivity extends FragmentActivity { -// -// @Override -// protected void onCreate(Bundle savedInstanceState) { -// super.onCreate(savedInstanceState); -// -//// if (getResources().getConfiguration().orientation -//// == Configuration.ORIENTATION_LANDSCAPE) { -//// // If the screen is now in landscape mode, we can show the -//// // dialog in-line so we don't need this activity. -//// finish(); -//// return; -//// } -// -// if (savedInstanceState == null) { -// // During initial setup, plug in the details fragment. -// Fragment details = new CramDeckFragment(); -// details.setArguments(getIntent().getExtras()); -// getSupportFragmentManager().beginTransaction().add(android.R.id.content, details).commit(); -// } -// } -// -//// -//// -//// private void closeStudyOptions() { -//// closeStudyOptions(RESULT_OK); -//// } -//// private void closeStudyOptions(int result) { -////// mCompat.invalidateOptionsMenu(this); -//// setResult(result); -//// finish(); -//// if (UIUtils.getApiLevel() > 4) { -//// ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.RIGHT); -//// } -//// } -// -// @Override -// public boolean onKeyDown(int keyCode, KeyEvent event) { -// if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { -// Log.i(AnkiDroidApp.TAG, "StudyOptions - onBackPressed()"); -//// if (mCurrentContentView == CONTENT_CONGRATS) { -//// finishCongrats(); -//// } else { -//// closeStudyOptions(); -//// } -// closeCramDeckAdder(); -// return true; -// } -// return super.onKeyDown(keyCode, event); -// } -// -// public void closeCramDeckAdder() { -// finish(); -// if (UIUtils.getApiLevel() > 4) { -// ActivityTransitionAnimation.slide(this, ActivityTransitionAnimation.RIGHT); -// } -// } -// -//} \ No newline at end of file diff --git a/src/com/ichi2/anki/CramDeckFragment.java b/src/com/ichi2/anki/CramDeckFragment.java deleted file mode 100644 index 228266c8d2..0000000000 --- a/src/com/ichi2/anki/CramDeckFragment.java +++ /dev/null @@ -1,268 +0,0 @@ -///*************************************************************************************** -// * Copyright (c) 2012 Norbert Nagold * -// * * -// * This program is free software; you can redistribute it and/or modify it under * -// * the terms of the GNU General Public License as published by the Free Software * -// * Foundation; either version 3 of the License, or (at your option) any later * -// * version. * -// * * -// * This program is distributed in the hope that it will be useful, but WITHOUT ANY * -// * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * -// * PARTICULAR PURPOSE. See the GNU General Public License for more details. * -// * * -// * You should have received a copy of the GNU General Public License along with * -// * this program. If not, see . * -// ****************************************************************************************/ -// -//package com.ichi2.anki; -// -//import java.util.ArrayList; -//import java.util.Collections; -//import java.util.Comparator; -// -//import org.json.JSONException; -//import org.json.JSONObject; -// -//import android.content.DialogInterface; -//import android.os.Bundle; -//import android.support.v4.app.Fragment; -//import android.support.v4.app.FragmentTransaction; -//import android.text.Editable; -//import android.text.TextWatcher; -//import android.view.LayoutInflater; -//import android.view.View; -//import android.view.View.OnClickListener; -//import android.view.ViewGroup; -//import android.widget.Button; -//import android.widget.EditText; -//import android.widget.LinearLayout; -//import android.widget.TextView; -// -//import com.ichi2.anki2.R; -//import com.ichi2.libanki.Collection; -//import com.ichi2.themes.StyledDialog; -//import com.ichi2.themes.Themes; -// -//public class CramDeckFragment extends Fragment { -// -// private EditText mCramDeckName; -// private LinearLayout mDecks; -// private TextView mDeckLabel; -// private EditText mSteps; -//// private EditText mOrder; -// private EditText mLimit; -// private EditText mInterval; -// private Button mCreateButton; -// private Button mCancelButton; -// -// private Collection mCol; -// private JSONObject mDeck; -// -// private boolean mFragmented; -// -// private StyledDialog mDecksDialog; -// -// public static CramDeckFragment newInstance(int index) { -// CramDeckFragment f = new CramDeckFragment(); -// Bundle args = new Bundle(); -// args.putInt("index", index); -// f.setArguments(args); -// -// return f; -// } -// -// public int getShownIndex() { -// return getArguments().getInt("index", 0); -// } -// -// @Override -// public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { -// if (container == null) { -// // Currently in a layout without a container, so no -// // reason to create our view. -// return null; -// } -// -// mFragmented = getActivity().getClass() != CramDeckActivity.class; -// -//// View main = inflater.inflate(R.layout.cram_deck, null); -//// mCramDeckName = (EditText) main.findViewById(R.id.cram_deck_name); -//// mCramDeckName.addTextChangedListener(new TextWatcher() { -//// @Override -//// public void afterTextChanged(Editable arg0) { -//// if (mCramDeckName.getText().length() == 0) { -//// mCreateButton.setEnabled(false); -//// } else { -//// mCreateButton.setEnabled(true); -//// } -//// } -//// @Override -//// public void beforeTextChanged(CharSequence arg0, int arg1, -//// int arg2, int arg3) { -//// } -//// @Override -//// public void onTextChanged(CharSequence arg0, int arg1, -//// int arg2, int arg3) { -//// } -//// }); -//// mDecks = (LinearLayout) main.findViewById(R.id.cram_deck_decks_button); -//// mDeckLabel = (TextView) main.findViewById(R.id.cram_deck_decks_text); -//// mDecks.setOnClickListener(new OnClickListener() { -//// @Override -//// public void onClick(View v) { -//// showDecksDialog(); -//// } -//// }); -//// mSteps = (EditText) main.findViewById(R.id.cram_deck_steps); -////// mOrder -//// mLimit = (EditText) main.findViewById(R.id.cram_deck_limit); -//// mInterval = (EditText) main.findViewById(R.id.cram_deck_interval); -//// mCreateButton = (Button) main.findViewById(R.id.cram_deck_create); -//// mCreateButton.setOnClickListener(new OnClickListener() { -//// @Override -//// public void onClick(View v) { -//// try { -//// mDeck.put("steps", DeckOptions.getDelays(mSteps.getText().toString())); -//// mDeck.put("search", mDeckLabel.getText().toString()); -////// mDeck.put("order", value); -//// mDeck.put("limit", Integer.parseInt(mLimit.getText().toString())); -//// mDeck.put("fmult", Integer.parseInt(mLimit.getText().toString()) / 100.0); -//// } catch (JSONException e) { -//// throw new RuntimeException(e); -//// } -//// mCol.getSched().rebuildDyn(mCol.getDecks().id("Cram 1")); -//// mCol.save(); -//// closeCramDeckAdder(); -//// } -//// }); -//// mCancelButton = (Button) main.findViewById(R.id.cram_deck_cancel); -//// mCancelButton.setOnClickListener(new OnClickListener() { -//// @Override -//// public void onClick(View v) { -//// closeCramDeckAdder(); -//// } -//// }); -//// -//// mCol = Collection.currentCollection(); -//// if (mCol == null) { -//// return null; -//// } -//// mDeck = mCol.getDecks().current(); -//// try { -//// if (mDeck.getInt("dyn") == 0) { -//// String currentDeckName = mDeck.getString("name"); -//// ArrayList names = mCol.getDecks().allNames(); -//// int n = 1; -//// String cramDeckName = "Cram 1"; -//// while (names.contains(cramDeckName)) { -//// n++; -//// cramDeckName = "Cram " + n; -//// } -//// mCol.getDecks().newDyn(cramDeckName); -//// mDeck = mCol.getDecks().current(); -//// mDeck.put("search", "\'deck:" + currentDeckName + "\'"); -//// } -//// mCramDeckName.setText(mDeck.getString("name")); -//// mDeckLabel.setText(mDeck.getString("search")); -//// mSteps.setText(DeckOptions.getDelays(mDeck.getJSONArray("delays"))); -////// TODO: set mOrder -//// mLimit.setText(Integer.toString(mDeck.getInt("limit"))); -//// mInterval.setText(Integer.toString((int)(mDeck.getDouble("fmult") * 100))); -//// } catch (JSONException e) { -//// throw new RuntimeException(e); -//// } -//// -//// if (!mFragmented) { -//// main.setBackgroundResource(R.drawable.white_wallpaper); -//// } -//// Themes.showThemedToast(this.getActivity(), "not yet implemented", false); -// return main; -// } -// -// private void closeCramDeckAdder() { -// if (mFragmented) { -// FragmentTransaction ft = getFragmentManager().beginTransaction(); -// ft.remove(CramDeckFragment.this); -// ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); -// ft.commit(); -// } else { -// ((CramDeckActivity)getActivity()).closeCramDeckAdder(); -// } -// } -// -// private void showDecksDialog() { -// if (mDecksDialog == null) { -// ArrayList dialogDeckItems = new ArrayList(); -// // Use this array to know which ID is associated with each -// // Item(name) -// final ArrayList dialogDeckIds = new ArrayList(); -// -// ArrayList decks = mCol.getDecks().all(); -// String currentName; -// try { -// currentName = mDeck.getString("name"); -// for (int i = 0; i < decks.size(); i++) { -// JSONObject d = decks.get(i); -// if (d.getString("name").equals(currentName)) { -// decks.remove(i); -// } -// } -// } catch (JSONException e1) { -// throw new RuntimeException(e1); -// } -// Collections.sort(decks, new JSONNameComparator()); -// StyledDialog.Builder builder = new StyledDialog.Builder(getActivity()); -// builder.setTitle(R.string.deck); -// for (JSONObject d : decks) { -// try { -// dialogDeckItems.add(DeckPicker.readableDeckName(d.getString("name").split("::"))); -// dialogDeckIds.add(d.getLong("id")); -// } catch (JSONException e) { -// throw new RuntimeException(e); -// } -// } -// // Convert to Array -// String[] items = new String[dialogDeckItems.size()]; -// dialogDeckItems.toArray(items); -// -// builder.setItems(items, new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int item) { -// try { -// mDeckLabel.setText("\'deck:" + mCol.getDecks().get(dialogDeckIds.get(item)).getString("name") + "\'"); -// } catch (JSONException e) { -// throw new RuntimeException(e); -// } -// } -// }); -// mDecksDialog = builder.create(); -// } -// mDecksDialog.show(); -// } -// -// public class JSONNameComparator implements Comparator { -// @Override -// public int compare(JSONObject lhs, JSONObject rhs) { -// String[] o1; -// String[] o2; -// try { -// o1 = lhs.getString("name").split("::"); -// o2 = rhs.getString("name").split("::"); -// } catch (JSONException e) { -// throw new RuntimeException(e); -// } -// for (int i = 0; i < Math.min(o1.length, o2.length); i++) { -// int result = o1[i].compareToIgnoreCase(o2[i]); -// if (result != 0) { -// return result; -// } -// } -// if (o1.length < o2.length) { -// return -1; -// } else if (o1.length > o2.length) { -// return 1; -// } else { -// return 0; -// } -// } -// } -//}