Skip to content
Permalink
Browse files

final commit before v1.0.0

- Typos
  • Loading branch information...
dimtion committed Feb 22, 2015
1 parent ec8d5eb commit 871f2ee100e56908b66203d37e12a7e8018b2095
@@ -8,8 +8,8 @@ android {
applicationId "com.dimtion.shaarlier"
minSdkVersion 15
targetSdkVersion 21
versionCode 4
versionName "0.2.2"
versionCode 5
versionName "1.0.0"

}
buildTypes {
@@ -1,9 +1,11 @@
package com.dimtion.shaarlier;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
@@ -79,20 +81,22 @@ public void loginHandler(View view){

Spinner protocolInput = (Spinner) findViewById(R.id.select_protocol);
String protocol = protocolInput.getSelectedItem().toString();

if (!givenUrl.equals("")) {
// Edit the user url :
if (!givenUrl.endsWith("/")) {
givenUrl += '/';
}

// Edit the user url :
if(!givenUrl.endsWith("/")){
givenUrl +='/';
}

if(givenUrl.startsWith("http://")){
givenUrl = givenUrl.replace("http://", "");
protocolInput.setSelection(0, true); // Update protocol prompt
protocol = "http://";
} else if (givenUrl.startsWith("https://")) {
givenUrl = givenUrl.replace("https://", "");
protocolInput.setSelection(1, true); // Update protocol prompt
protocol = "https://";
if (givenUrl.startsWith("http://")) {
givenUrl = givenUrl.replace("http://", "");
protocolInput.setSelection(0, true); // Update protocol prompt
protocol = "http://";
} else if (givenUrl.startsWith("https://")) {
givenUrl = givenUrl.replace("https://", "");
protocolInput.setSelection(1, true); // Update protocol prompt
protocol = "https://";
}
}
// Update url prompt :
urlInput.setText(givenUrl);
@@ -147,7 +151,7 @@ void updateSettingsFromUpdate(SharedPreferences pref){
SharedPreferences.Editor editor = pref.edit();
editor.putString(getString(R.string.p_user_url), url)
.putInt(getString(R.string.p_protocol), protocol)
.commit();
.apply();
}

}
@@ -205,6 +209,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
} else if (id == R.id.action_go_to_shaarli) {
SharedPreferences pref = getSharedPreferences(getString(R.string.params), MODE_PRIVATE);
updateSettingsFromUpdate(pref);

String url = pref.getString(getString(R.string.p_url_shaarli), getString(R.string.developer_shaarli));

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
}

return super.onOptionsItemSelected(item);
@@ -50,7 +50,8 @@
android:layout_height="wrap_content"
android:id="@+id/url_shaarli_input"
android:inputType="textUri"
android:layout_weight="1" />
android:layout_weight="1"
android:hint="@string/url_hint" />
</LinearLayout>

<TextView
@@ -65,7 +66,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/username_input"
android:inputType="textPersonName" />
android:inputType="textPersonName"
android:hint="@string/username_hint" />

<TextView
android:layout_width="wrap_content"
@@ -122,29 +124,33 @@
android:text="@string/default_private"
android:id="@+id/default_private"
android:checked="true"
android:layout_marginTop="10dp" />
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp" />

<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_show_share_dialog"
android:id="@+id/show_share_dialog"
android:checked="false" />
android:checked="false"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />

<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/auto_load_title"
android:id="@+id/auto_load_title"
android:checked="true" />
android:checked="true"
android:layout_marginTop="5dp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/text_about"
android:id="@+id/textView4"
android:layout_marginTop="25dp"
android:layout_marginTop="35dp"
android:layout_marginBottom="10dp" />

<TextView
@@ -154,14 +160,6 @@
android:text="@string/text_about_details"
android:id="@+id/about_details" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/more"
android:id="@+id/textView5"
android:layout_gravity="right"
android:layout_marginTop="20dp" />
</LinearLayout>

</ScrollView>
@@ -3,4 +3,6 @@
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_go_to_shaarli" android:title="@string/action_go_to_shaarli"
android:orderInCategory="101" app:showAsAction="never" />
</menu>
@@ -26,11 +26,13 @@
<string name="title_hint">Titre</string>
<string name="user_name">Pseudo :</string>
<string name="user_password">Mot de passe :</string>
<string name="your_shaarli_url">L\'url de votre Shaarli :</string>
<string name="your_shaarli_url">Url de votre Shaarli :</string>
<string name="text_about_details">Pour utiliser cette application vous avez besoin d\'un <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli" >Shaarli</a>, un clone minimaliste de delicious.
Cette application est fièrement développée par dimtion, vous pouvez me trouver sur mon <a href="https://github.com/dimtion/Shaarlier">github </a> (et d\'autres recoins d\'internet).
Si vous trouvez le moindre bug ou avez une idée de fonctionnalité, n\'hésitez pas à publier sur le <a href="https://github.com/dimtion/Shaarlier/issues">bug tracker.</a></string>
<string name="loading_title_hint">Chargement du title…</string>
<string name="error_retrieving_title">Erreur chargement titre</string>
<string name="auto_load_title">Charger automatiquement le title de la page</string>
<string name="auto_load_title">Charger automatiquement le titre de la page</string>
<string name="url_hint">shaarli.monserveur.fr</string>
<string name="action_go_to_shaarli">Aller à mon Shaarli</string>
</resources>
@@ -49,4 +49,8 @@
<string name="loading_title_hint">Loading title…</string>
<string name="error_retrieving_title">Title could not be loaded</string>
<string name="auto_load_title">Automatically load page title</string>
<string name="username_hint" translatable="false">Batman</string>
<string name="url_hint">shaarli.myserver.org</string>
<string name="action_go_to_shaarli">Open my Shaarli</string>
<string name="developer_shaarli" translatable="false">https://dimtion.taupincretin.com/shaarli</string>
</resources>

0 comments on commit 871f2ee

Please sign in to comment.
You can’t perform that action at this time.