Browse Source

2 activités séparés pour les paramètres (config+param)

+ jniLibs replaced by original libs generated by tesseract
+ home page update: new Background !, updated texviews and co
master
Vincent KHERBACHE 10 years ago
parent
commit
bbfd08690e
  1. 9
      app/src/main/AndroidManifest.xml
  2. 167
      app/src/main/java/fr/android/pointspermis/MainActivity.java
  3. 19
      app/src/main/java/fr/android/pointspermis/NavigationDrawerFragment.java
  4. 15
      app/src/main/java/fr/android/pointspermis/settings/DossierDialogPreference.java
  5. 62
      app/src/main/java/fr/android/pointspermis/settings/SettingsActivity.java
  6. 3
      app/src/main/jniLibs/armeabi-v7a/gdb.setup
  7. 3
      app/src/main/jniLibs/armeabi/gdb.setup
  8. 3
      app/src/main/jniLibs/mips/gdb.setup
  9. 3
      app/src/main/jniLibs/x86/gdb.setup
  10. 3
      app/src/main/res/layout/dossier_dialog.xml
  11. 39
      app/src/main/res/layout/fragment_main.xml
  12. 2
      app/src/main/res/layout/fragment_navigation_drawer.xml
  13. 4
      app/src/main/res/menu/global.xml
  14. 5
      app/src/main/res/menu/main.xml
  15. 12
      app/src/main/res/values/strings.xml
  16. 15
      app/src/main/res/values/strings_activity_settings.xml
  17. 11
      tesseract/build.gradle

9
app/src/main/AndroidManifest.xml

@ -19,6 +19,15 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".settings.ConfigActivity"
android:label="@string/title_activity_config"
android:parentActivityName=".MainActivity" >
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity <activity
android:name=".settings.SettingsActivity" android:name=".settings.SettingsActivity"
android:label="@string/title_activity_settings" android:label="@string/title_activity_settings"

167
app/src/main/java/fr/android/pointspermis/MainActivity.java

@ -24,6 +24,7 @@ import java.io.File;
import java.util.List; import java.util.List;
import fr.android.pointspermis.captcha.Captcha; import fr.android.pointspermis.captcha.Captcha;
import fr.android.pointspermis.settings.ConfigActivity;
import fr.android.pointspermis.settings.SettingsActivity; import fr.android.pointspermis.settings.SettingsActivity;
import fr.android.pointspermis.tools.AssetsTools; import fr.android.pointspermis.tools.AssetsTools;
import fr.android.pointspermis.web.WebTask; import fr.android.pointspermis.web.WebTask;
@ -32,8 +33,14 @@ import fr.android.pointspermis.web.WebTask;
public class MainActivity extends Activity public class MainActivity extends Activity
implements NavigationDrawerFragment.NavigationDrawerCallbacks { implements NavigationDrawerFragment.NavigationDrawerCallbacks {
public final static String SOLDE_KEY = "solde";
public final static String USERNAME_KEY = "username";
public final static String BIRTHDAY_KEY = "birthday";
private final Context context = this; private final Context context = this;
private ActionBar actionBar;
private WebTask webform; private WebTask webform;
private SharedPreferences prefs; private SharedPreferences prefs;
@ -43,17 +50,14 @@ public class MainActivity extends Activity
private String username; private String username;
private String birthday; private String birthday;
/** /**
* Fragment managing the behaviors, interactions and presentation of the navigation drawer. * Fragment managing the behaviors, interactions and presentation of the navigation drawer.
*/ */
private FragmentManager fragmentManager;
private NavigationDrawerFragment mNavigationDrawerFragment; private NavigationDrawerFragment mNavigationDrawerFragment;
private PlaceholderFragment mPlaceholderFrament; private PlaceholderFragment mPlaceholderFrament;
/**
* Used to store the last screen title. For use in {@link #restoreActionBar()}.
*/
private CharSequence mTitle;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -69,23 +73,36 @@ public class MainActivity extends Activity
// Copy tesseract data to app-specific internal storage (language stuff) // Copy tesseract data to app-specific internal storage (language stuff)
copyTesseractData(); copyTesseractData();
mNavigationDrawerFragment = (NavigationDrawerFragment) // Get actionBar
getFragmentManager().findFragmentById(R.id.navigation_drawer); actionBar = getActionBar();
mTitle = getTitle();
// Get fragment manager
fragmentManager = getFragmentManager();
// Set up the drawer. // Set up the drawer.
mNavigationDrawerFragment = (NavigationDrawerFragment)
fragmentManager.findFragmentById(R.id.navigation_drawer);
mNavigationDrawerFragment.setUp( mNavigationDrawerFragment.setUp(
R.id.navigation_drawer, R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_layout)); (DrawerLayout) findViewById(R.id.drawer_layout)
);
// Load prefs // Load prefs
prefs = getSharedPreferences("fr.android.pointspermis", MODE_PRIVATE); prefs = getSharedPreferences("fr.android.pointspermis", MODE_PRIVATE);
editor = prefs.edit(); editor = prefs.edit();
// Try to get saved values // Try to get saved values
solde = prefs.getString("solde", ""); solde = prefs.getString(SOLDE_KEY, " ");
username = prefs.getString("username", ""); username = prefs.getString(USERNAME_KEY, "");
birthday = prefs.getString("birthday", ""); birthday = prefs.getString(BIRTHDAY_KEY, "");
// Set the main fragment with args
mPlaceholderFrament = new PlaceholderFragment();
Bundle args = new Bundle();
args.putString(SOLDE_KEY, solde);
args.putString(USERNAME_KEY, username);
args.putString(BIRTHDAY_KEY, birthday);
mPlaceholderFrament.setArguments(args);
fragmentManager.beginTransaction().replace(R.id.container, mPlaceholderFrament).commit();
} }
public void copyTesseractData() { public void copyTesseractData() {
@ -115,35 +132,30 @@ public class MainActivity extends Activity
@Override @Override
public void onNavigationDrawerItemSelected(int position) { public void onNavigationDrawerItemSelected(int position) {
// update the main content by replacing fragments /* update the main content by replacing fragments
FragmentManager fragmentManager = getFragmentManager();
mPlaceholderFrament = PlaceholderFragment.newInstance(position + 1); mPlaceholderFrament = PlaceholderFragment.newInstance(position + 1);
fragmentManager.beginTransaction().replace(R.id.container, mPlaceholderFrament).commit();*/
fragmentManager.beginTransaction().replace(R.id.container, mPlaceholderFrament).commit(); // Manage actions on drawer's clicks
} if (position == 0) {
Intent i = new Intent(this, ConfigActivity.class);
public void onSectionAttached(int number) { startActivity(i);
switch (number) { }
case 1: if (position == 1) {
mTitle = getString(R.string.title_home); Intent i = new Intent(this, SettingsActivity.class);
break; startActivity(i);
case 2: }
mTitle = getString(R.string.title_settings); if (position == 2) {
Intent i = new Intent(this, SettingsActivity.class); quit();
startActivity(i);
break;
} }
} }
public void restoreActionBar() { public void restoreActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(mTitle); actionBar.setTitle(R.string.app_name);
} }
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
if (!mNavigationDrawerFragment.isDrawerOpen()) { if (!mNavigationDrawerFragment.isDrawerOpen()) {
@ -165,6 +177,12 @@ public class MainActivity extends Activity
int id = item.getItemId(); int id = item.getItemId();
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
if (id == R.id.action_config) {
Intent i = new Intent(this, ConfigActivity.class);
startActivity(i);
return true;
}
if (id == R.id.action_settings) { if (id == R.id.action_settings) {
Intent i = new Intent(this, SettingsActivity.class); Intent i = new Intent(this, SettingsActivity.class);
startActivity(i); startActivity(i);
@ -175,10 +193,10 @@ public class MainActivity extends Activity
// Initialize and execute the WebForm async task // Initialize and execute the WebForm async task
webform = new WebTask(context, MainActivity.this); webform = new WebTask(context, MainActivity.this);
webform.execute(prefs.getString(SettingsActivity.DOSSIER1_KEY, ""), webform.execute(prefs.getString(ConfigActivity.DOSSIER1_KEY, ""),
prefs.getString(SettingsActivity.DOSSIER2_KEY, ""), prefs.getString(ConfigActivity.DOSSIER2_KEY, ""),
prefs.getString(SettingsActivity.DOSSIER3_KEY, ""), prefs.getString(ConfigActivity.DOSSIER3_KEY, ""),
prefs.getString(SettingsActivity.CODE_KEY, "") prefs.getString(ConfigActivity.CODE_KEY, "")
); );
return true; return true;
} }
@ -190,67 +208,14 @@ public class MainActivity extends Activity
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
/** public void setInfos(List<String> infos) {
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
private TextView textViewSolde;
private TextView textViewUserName;
private TextView textViewBirthday;
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public PlaceholderFragment() {
}
public void setInfos(List<String> infos) {
// Show values
textViewSolde.setText(infos.get(0));
textViewSolde.invalidate();
textViewUserName.setText(infos.get(1));
textViewUserName.invalidate();
textViewBirthday.setText(infos.get(2));
textViewBirthday.invalidate();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
textViewSolde = (TextView) rootView.findViewById(R.id.textViewSolde);
textViewUserName = (TextView) rootView.findViewById(R.id.textViewUserName);
textViewBirthday = (TextView) rootView.findViewById(R.id.textViewBirthday);
return rootView;
}
@Override // Store infos
public void onAttach(Activity activity) { solde = infos.get(0);
super.onAttach(activity); username = infos.get(1);
((MainActivity) activity).onSectionAttached( birthday = infos.get(2);
getArguments().getInt(ARG_SECTION_NUMBER));
}
}
public void setInfos(List<String> infos) { saveUserData();
// Set infos to the fragment // Set infos to the fragment
mPlaceholderFrament.setInfos(infos); mPlaceholderFrament.setInfos(infos);
@ -258,17 +223,17 @@ public class MainActivity extends Activity
private void saveUserData() { private void saveUserData() {
editor.putString("solde", solde); editor.putString(SOLDE_KEY, solde);
editor.putString("username", username); editor.putString(USERNAME_KEY, username);
editor.putString("birthday", birthday); editor.putString(BIRTHDAY_KEY, birthday);
editor.commit(); editor.commit();
} }
public void quit() { public void quit() {
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
.setMessage("Quitter ?") .setMessage(getString(R.string.question_quit))
.setCancelable(false) .setCancelable(false)
.setPositiveButton("Oui", new DialogInterface.OnClickListener() { .setPositiveButton(getString(R.string.action_yes), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
// Save user data // Save user data
@ -278,7 +243,7 @@ public class MainActivity extends Activity
MainActivity.this.finish(); MainActivity.this.finish();
} }
}) })
.setNegativeButton("Non", new DialogInterface.OnClickListener() { .setNegativeButton(getString(R.string.action_no), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dialog.dismiss(); dialog.dismiss();
} }

19
app/src/main/java/fr/android/pointspermis/NavigationDrawerFragment.java

@ -4,6 +4,7 @@ package fr.android.pointspermis;
import android.app.Activity; import android.app.Activity;
import android.app.ActionBar; import android.app.ActionBar;
import android.app.Fragment; import android.app.Fragment;
import android.content.Intent;
import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat; import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
@ -22,6 +23,8 @@ import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import fr.android.pointspermis.settings.SettingsActivity;
/** /**
* Fragment used for managing interactions for and presentation of a navigation drawer. * Fragment used for managing interactions for and presentation of a navigation drawer.
* See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction"> * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction">
@ -54,10 +57,13 @@ public class NavigationDrawerFragment extends Fragment {
private ListView mDrawerListView; private ListView mDrawerListView;
private View mFragmentContainerView; private View mFragmentContainerView;
private int mCurrentSelectedPosition = 0; private int mCurrentSelectedPosition = -1;
private boolean mFromSavedInstanceState; private boolean mFromSavedInstanceState;
private boolean mUserLearnedDrawer; private boolean mUserLearnedDrawer;
private ActionBar actionBar;
public NavigationDrawerFragment() { public NavigationDrawerFragment() {
} }
@ -75,6 +81,9 @@ public class NavigationDrawerFragment extends Fragment {
mFromSavedInstanceState = true; mFromSavedInstanceState = true;
} }
// Get action bar
actionBar = getActionBar();
// Select either the default item (0) or the last selected item. // Select either the default item (0) or the last selected item.
selectItem(mCurrentSelectedPosition); selectItem(mCurrentSelectedPosition);
} }
@ -102,8 +111,9 @@ public class NavigationDrawerFragment extends Fragment {
android.R.layout.simple_list_item_activated_1, android.R.layout.simple_list_item_activated_1,
android.R.id.text1, android.R.id.text1,
new String[]{ new String[]{
getString(R.string.title_home), getString(R.string.title_activity_config),
getString(R.string.title_settings), getString(R.string.title_activity_settings),
getString(R.string.action_quit)
})); }));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView; return mDrawerListView;
@ -234,7 +244,7 @@ public class NavigationDrawerFragment extends Fragment {
// If the drawer is open, show the global app actions in the action bar. See also // If the drawer is open, show the global app actions in the action bar. See also
// showGlobalContextActionBar, which controls the top-left area of the action bar. // showGlobalContextActionBar, which controls the top-left area of the action bar.
if (mDrawerLayout != null && isDrawerOpen()) { if (mDrawerLayout != null && isDrawerOpen()) {
inflater.inflate(R.menu.global, menu); inflater.inflate(R.menu.main, menu);
showGlobalContextActionBar(); showGlobalContextActionBar();
} }
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);
@ -259,7 +269,6 @@ public class NavigationDrawerFragment extends Fragment {
* 'context', rather than just what's in the current screen. * 'context', rather than just what's in the current screen.
*/ */
private void showGlobalContextActionBar() { private void showGlobalContextActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name); actionBar.setTitle(R.string.app_name);

15
app/src/main/java/fr/android/pointspermis/settings/DossierDialogPreference.java

@ -10,6 +10,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import fr.android.pointspermis.MainActivity;
import fr.android.pointspermis.R; import fr.android.pointspermis.R;
/** /**
@ -36,9 +37,9 @@ public class DossierDialogPreference extends DialogPreference {
editor = prefs.edit(); editor = prefs.edit();
// Try to get old saved values // Try to get old saved values
dossier1 = prefs.getString(context.getString(R.string.pref_key_dossier1), ""); dossier1 = prefs.getString(ConfigActivity.DOSSIER1_KEY, "");
dossier2 = prefs.getString(context.getString(R.string.pref_key_dossier2), ""); dossier2 = prefs.getString(ConfigActivity.DOSSIER2_KEY, "");
dossier3 = prefs.getString(context.getString(R.string.pref_key_dossier3), ""); dossier3 = prefs.getString(ConfigActivity.DOSSIER3_KEY, "");
// Update summary // Update summary
updateSummary(); updateSummary();
@ -83,10 +84,10 @@ public class DossierDialogPreference extends DialogPreference {
updateSummary(); updateSummary();
// Save parameters // Save parameters
editor.putString(context.getString(R.string.pref_key_dossier1), dossier1); editor.putString(ConfigActivity.DOSSIER1_KEY, dossier1);
editor.putString(context.getString(R.string.pref_key_dossier2), dossier2); editor.putString(ConfigActivity.DOSSIER2_KEY, dossier2);
editor.putString(context.getString(R.string.pref_key_dossier3), dossier3); editor.putString(ConfigActivity.DOSSIER3_KEY, dossier3);
editor.putString(context.getString(R.string.pref_key_dossier), editor.putString(ConfigActivity.DOSSIER_KEY,
dossier1 + " " + dossier2 + " " + dossier3); dossier1 + " " + dossier2 + " " + dossier3);
editor.commit(); editor.commit();

62
app/src/main/java/fr/android/pointspermis/settings/SettingsActivity.java

@ -36,15 +36,10 @@ import fr.android.pointspermis.R;
*/ */
public class SettingsActivity extends PreferenceActivity { public class SettingsActivity extends PreferenceActivity {
public static String DOSSIER_KEY; public final static String NOTIFICATION_KEY = "notifications";
public static String DOSSIER1_KEY; public final static String FREQUENCY_KEY = "sync_frequency";
public static String DOSSIER2_KEY; public final static String RINGTONE_KEY = "notifications_ringtone";
public static String DOSSIER3_KEY; public final static String VIBRATE_KEY = "notifications_vibrate";
public static String CODE_KEY;
public static String NOTIFICATION_KEY;
public static String FREQUENCY_KEY;
public static String RINGTONE_KEY;
public static String VIBRATE_KEY;
/** /**
* Determines whether to always show the simplified settings UI, where * Determines whether to always show the simplified settings UI, where
@ -66,17 +61,6 @@ public class SettingsActivity extends PreferenceActivity {
// Shared prefs // Shared prefs
prefs = getSharedPreferences("fr.android.pointspermis", MODE_PRIVATE); prefs = getSharedPreferences("fr.android.pointspermis", MODE_PRIVATE);
editor = prefs.edit(); editor = prefs.edit();
// Get the key name of settings elements
DOSSIER_KEY = getString(R.string.pref_key_dossier);
DOSSIER1_KEY = getString(R.string.pref_key_dossier1);
DOSSIER2_KEY = getString(R.string.pref_key_dossier2);
DOSSIER3_KEY = getString(R.string.pref_key_dossier3);
CODE_KEY = getString(R.string.pref_key_code);
NOTIFICATION_KEY = getString(R.string.pref_key_enable_notifications);
FREQUENCY_KEY = getString(R.string.pref_key_sync_frequency);
RINGTONE_KEY = getString(R.string.pref_key_ringtone);
VIBRATE_KEY = getString(R.string.pref_key_vibrate);
} }
@Override @Override
@ -115,17 +99,12 @@ public class SettingsActivity extends PreferenceActivity {
// In the simplified UI, fragments are not used at all and we instead // In the simplified UI, fragments are not used at all and we instead
// use the older PreferenceActivity APIs. // use the older PreferenceActivity APIs.
// Add 'connection' preferences.
addPreferencesFromResource(R.xml.pref_connection);
// Add 'notifications' preferences, and a corresponding header. // Add 'notifications' preferences, and a corresponding header.
addPreferencesFromResource(R.xml.pref_notification); addPreferencesFromResource(R.xml.pref_notification);
// Bind the summaries of EditText/List/Dialog/Ringtone preferences to // Bind the summaries of EditText/List/Dialog/Ringtone preferences to
// their values. When their values change, their summaries are updated // their values. When their values change, their summaries are updated
// to reflect the new value, per the Android Design guidelines. // to reflect the new value, per the Android Design guidelines.
manageValueAndSummary(findPreference(DOSSIER_KEY));
manageValueAndSummary(findPreference(CODE_KEY));
manageValueAndSummary(findPreference(NOTIFICATION_KEY)); manageValueAndSummary(findPreference(NOTIFICATION_KEY));
manageValueAndSummary(findPreference(FREQUENCY_KEY)); manageValueAndSummary(findPreference(FREQUENCY_KEY));
manageValueAndSummary(findPreference(RINGTONE_KEY)); manageValueAndSummary(findPreference(RINGTONE_KEY));
@ -144,31 +123,6 @@ public class SettingsActivity extends PreferenceActivity {
String key = preference.getKey(); String key = preference.getKey();
if (key.equals(DOSSIER_KEY)) {
/* No need to save values or update the summary as this is already done in
* custom dialogPreference, but anyway we still do it ..
*/
// Update the summary
((DossierDialogPreference) preference).updateSummary();
// Get and save the dossier number
String dossier1 = ((DossierDialogPreference) preference).getDossier1();
String dossier2 = ((DossierDialogPreference) preference).getDossier2();
String dossier3 = ((DossierDialogPreference) preference).getDossier3();
editor.putString(DOSSIER1_KEY, dossier1);
editor.putString(DOSSIER2_KEY, dossier2);
editor.putString(DOSSIER3_KEY, dossier3);
editor.putString(DOSSIER_KEY, dossier1 + " " + dossier2 + " " + dossier3);
}
if (key.equals(CODE_KEY)) {
/* Do not change summary: code is private ! */
// Save the value
editor.putString(key, value.toString());
}
if (key.equals(NOTIFICATION_KEY)) { if (key.equals(NOTIFICATION_KEY)) {
// For checkbox, just save the value // For checkbox, just save the value
@ -286,14 +240,6 @@ public class SettingsActivity extends PreferenceActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_connection);
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
// to their values. When their values change, their summaries are
// updated to reflect the new value, per the Android Design
// guidelines.
manageValueAndSummary(findPreference(DOSSIER_KEY));
manageValueAndSummary(findPreference(CODE_KEY));
} }
} }

3
app/src/main/jniLibs/armeabi-v7a/gdb.setup

@ -1,3 +0,0 @@
set solib-search-path /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/obj/local/armeabi-v7a
source /opt/android/android-ndk-r10d/prebuilt/common/gdb/common.setup
directory /opt/android/android-ndk-r10d/platforms/android-8/arch-arm/usr/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++ /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android/src/src /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/api /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccmain /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccstruct /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/classify /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cube /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/dict /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/opencl /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/neural_networks/runtime /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/textord /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/viewer /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/wordrec

3
app/src/main/jniLibs/armeabi/gdb.setup

@ -1,3 +0,0 @@
set solib-search-path /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/obj/local/armeabi
source /opt/android/android-ndk-r10d/prebuilt/common/gdb/common.setup
directory /opt/android/android-ndk-r10d/platforms/android-8/arch-arm/usr/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++ /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android/src/src /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/api /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccmain /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccstruct /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/classify /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cube /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/dict /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/opencl /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/neural_networks/runtime /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/textord /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/viewer /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/wordrec

3
app/src/main/jniLibs/mips/gdb.setup

@ -1,3 +0,0 @@
set solib-search-path /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/obj/local/mips
source /opt/android/android-ndk-r10d/prebuilt/common/gdb/common.setup
directory /opt/android/android-ndk-r10d/platforms/android-9/arch-mips/usr/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++ /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android/src/src /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/api /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccmain /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccstruct /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/classify /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cube /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/dict /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/opencl /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/neural_networks/runtime /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/textord /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/viewer /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/wordrec

3
app/src/main/jniLibs/x86/gdb.setup

@ -1,3 +0,0 @@
set solib-search-path /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/obj/local/x86
source /opt/android/android-ndk-r10d/prebuilt/common/gdb/common.setup
directory /opt/android/android-ndk-r10d/platforms/android-9/arch-x86/usr/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++ /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_leptonica_android/src/src /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include /opt/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/api /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccmain /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccstruct /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/ccutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/classify /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cube /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/cutil /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/dict /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/opencl /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/neural_networks/runtime /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/textord /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/viewer /home/vins/AndroidStudioProjects/PointsPermis/tesseract/src/main/jni/com_googlecode_tesseract_android/src/wordrec

3
app/src/main/res/layout/dossier_dialog.xml

@ -24,6 +24,7 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:windowSoftInputMode="stateAlwaysVisible" android:windowSoftInputMode="stateAlwaysVisible"
android:autoText="true" android:autoText="true"
android:maxLength="13"
android:lines="1" /> android:lines="1" />
<EditText <EditText
@ -40,6 +41,7 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:windowSoftInputMode="stateAlwaysVisible" android:windowSoftInputMode="stateAlwaysVisible"
android:autoText="true" android:autoText="true"
android:maxLength="3"
android:lines="1" /> android:lines="1" />
<EditText <EditText
@ -57,6 +59,7 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:windowSoftInputMode="stateAlwaysVisible" android:windowSoftInputMode="stateAlwaysVisible"
android:autoText="true" android:autoText="true"
android:maxLength="3"
android:lines="1" /> android:lines="1" />
</LinearLayout> </LinearLayout>

39
app/src/main/res/layout/fragment_main.xml

@ -5,33 +5,44 @@
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity$PlaceholderFragment" tools:context=".MainActivity$PlaceholderFragment"
android:id="@+id/layout_fragment_main"> android:id="@+id/layout_fragment_main"
android:background="@drawable/background_home">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textViewBirthday"
android:layout_marginTop="110dp"
android:layout_below="@+id/textViewUserName"
android:layout_centerHorizontal="true" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textViewSolde" android:id="@+id/textViewSolde"
android:layout_below="@+id/textViewBirthday" android:lines="1"
android:maxLines="1"
android:layout_marginBottom="50dp"
android:textSize="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="99dp" /> android:text=" "
android:background="@drawable/shape" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textViewUserName" android:id="@+id/textViewUserName"
android:layout_marginTop="23dp"
android:lines="1"
android:maxLines="1"
android:text=" "
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/textViewSolde" android:layout_centerHorizontal="true" />
android:layout_alignStart="@+id/textViewSolde"
android:layout_marginTop="34dp" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/show_solde"
android:id="@+id/textView"
android:layout_above="@+id/textViewSolde"
android:layout_centerHorizontal="true"
android:textStyle="bold"
android:layout_marginBottom="5dp" />
</RelativeLayout> </RelativeLayout>

2
app/src/main/res/layout/fragment_navigation_drawer.xml

@ -2,4 +2,4 @@
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:choiceMode="singleChoice" android:layout_height="match_parent" android:choiceMode="singleChoice"
android:divider="@android:color/transparent" android:dividerHeight="0dp" android:divider="@android:color/transparent" android:dividerHeight="0dp"
android:background="#cccc" tools:context=".NavigationDrawerFragment" /> android:background="#ff000000" tools:context=".NavigationDrawerFragment" />

4
app/src/main/res/menu/global.xml

@ -1,4 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" android:showAsAction="never" />
</menu>

5
app/src/main/res/menu/main.xml

@ -5,7 +5,10 @@
android:orderInCategory="100" android:orderInCategory="100"
android:icon="@drawable/ic_action_refresh" android:icon="@drawable/ic_action_refresh"
android:showAsAction="withText|ifRoom" android:showAsAction="withText|ifRoom"
android:title="@string/action_example"/> android:title="@string/action_refresh"/>
<item android:id="@+id/action_config" android:title="@string/action_config"
android:orderInCategory="100" android:showAsAction="never" />
<item android:id="@+id/action_settings" android:title="@string/action_settings" <item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" android:showAsAction="never" /> android:orderInCategory="100" android:showAsAction="never" />

12
app/src/main/res/values/strings.xml

@ -1,18 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="show_solde"><u>Solde :</u></string>
<string name="app_name">PointsPermis</string> <string name="app_name">PointsPermis</string>
<string name="title_home">Accueil</string>
<string name="title_settings">Paramètres</string>
<string name="title_section3">Section 3</string>
<string name="navigation_drawer_open">Ouvrir le volet de navigation</string> <string name="navigation_drawer_open">Ouvrir le volet de navigation</string>
<string name="navigation_drawer_close">Fermer le volet de navigation</string> <string name="navigation_drawer_close">Fermer le volet de navigation</string>
<string name="action_example">Actualiser</string> <string name="action_refresh">Actualiser</string>
<string name="action_settings">Paramètres</string> <string name="action_settings">Paramètres</string>
<string name="action_config">Configuration</string>
<string name="action_valid">Valider</string> <string name="action_valid">Valider</string>
<string name="question_quit">Êtes-vous sûr de vouloir quitter ?</string>
<string name="action_quit">Quitter</string> <string name="action_quit">Quitter</string>
<string name="action_cancel">Annuler</string> <string name="action_cancel">Annuler</string>
<string name="action_yes">Oui</string> <string name="action_yes">Oui</string>
<string name="action_no">Non</string> <string name="action_no">Non</string>
<string name="key_solde">solde</string>
<string name="key_username">username</string>
<string name="key_birthday">birthday</string>
</resources> </resources>

15
app/src/main/res/values/strings_activity_settings.xml

@ -1,28 +1,19 @@
<resources> <resources>
<!-- Strings related to Settings -->
<string name="title_activity_settings">Paramètres</string> <string name="title_activity_settings">Paramètres</string>
<string name="title_activity_config">Configuration</string>
<!-- Connection settings --> <!-- Connection settings -->
<string name="pref_header_connection">Connexion</string> <string name="pref_header_connection">Connexion</string>
<string name="pref_descr_connection">Configuration de la connexion</string> <string name="pref_descr_connection">Configuration de la connexion</string>
<string name="pref_title_dossier">Numéro de dossier</string> <string name="pref_title_dossier">Numéro de dossier</string>
<string name="pref_key_dossier">dossier</string> <string name="pref_title_code">Code personnel</string>
<string name="pref_key_dossier1">dossier1</string>
<string name="pref_key_dossier2">dossier2</string>
<string name="pref_key_dossier3">dossier3</string>
<string name="pref_title_code">Code confidentiel</string>
<string name="pref_key_code">code</string>
<!-- Settings for Notification & Sync --> <!-- Settings for Notification & Sync -->
<string name="pref_header_notifications">Notifications</string> <string name="pref_header_notifications">Notifications</string>
<string name="pref_descr_notifications">Configuration des notifications</string> <string name="pref_descr_notifications">Configuration des notifications</string>
<string name="pref_title_enable_notifications">Activer les notifications</string> <string name="pref_title_enable_notifications">Activer les notifications</string>
<string name="pref_key_enable_notifications">notifications</string>
<string name="pref_title_sync_frequency">Fréquence de synchronisation</string> <string name="pref_title_sync_frequency">Fréquence de synchronisation</string>
<string name="pref_key_sync_frequency">sync_frequency</string>
<string-array name="pref_sync_frequency_titles"> <string-array name="pref_sync_frequency_titles">
<item>Mensuelle</item> <item>Mensuelle</item>
<item>Bimensuelle</item> <item>Bimensuelle</item>
@ -36,9 +27,7 @@
<item>1</item> <item>1</item>
</string-array> </string-array>
<string name="pref_title_ringtone">Sonnerie</string> <string name="pref_title_ringtone">Sonnerie</string>
<string name="pref_key_ringtone">notifications_ringtone</string>
<string name="pref_ringtone_silent">Silencieuse</string> <string name="pref_ringtone_silent">Silencieuse</string>
<string name="pref_title_vibrate">Vibrer</string> <string name="pref_title_vibrate">Vibrer</string>
<string name="pref_key_vibrate">notifications_vibrate</string>
</resources> </resources>

11
tesseract/build.gradle

@ -12,8 +12,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
} }
} }
//// This prevents the auto generation of Android.mk
// This prevents the auto generation of Android.mk
sourceSets.main.jni.srcDirs = [] sourceSets.main.jni.srcDirs = []
// Manually specify jniLibs directory (this prevents copying libs files to app dir)
sourceSets.main.jniLibs.srcDir 'src/main/libs'
task buildNative(type: Exec, description: 'Compile JNI source via NDK') { task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
def ndkDir = android.plugin.ndkFolder def ndkDir = android.plugin.ndkFolder
commandLine "$ndkDir/ndk-build", commandLine "$ndkDir/ndk-build",
@ -28,14 +33,18 @@ android {
'-C', file('src/main/jni').absolutePath, '-C', file('src/main/jni').absolutePath,
'clean' 'clean'
} }
clean.dependsOn 'cleanNative' clean.dependsOn 'cleanNative'
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNative compileTask -> compileTask.dependsOn buildNative
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7 sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7
} }
productFlavors { productFlavors {
} }
} }

Loading…
Cancel
Save