Modification du Layout et des textes.

This commit is contained in:
Jonathan GAULUPEAU 2013-08-08 19:53:18 +02:00
parent 3f47c39fb2
commit 518e708b29
12 changed files with 101 additions and 47 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17,12 +17,14 @@ public final class R {
public static final int icon=0x7f020000; public static final int icon=0x7f020000;
} }
public static final class id { public static final class id {
public static final int author=0x7f060004; public static final int author=0x7f060007;
public static final int btnDone=0x7f060005; public static final int btnDone=0x7f060006;
public static final int instructions=0x7f060003; public static final int imageView1=0x7f060001;
public static final int pageUrl_label=0x7f060001; public static final int instructions=0x7f060005;
public static final int pocheUrl=0x7f060002; public static final int pageUrl_label=0x7f060002;
public static final int pocheUrl=0x7f060004;
public static final int scrollView1=0x7f060000; public static final int scrollView1=0x7f060000;
public static final int textView1=0x7f060003;
} }
public static final class layout { public static final class layout {
public static final int main=0x7f030000; public static final int main=0x7f030000;
@ -34,6 +36,7 @@ public final class R {
public static final int btnDone=0x7f050004; public static final int btnDone=0x7f050004;
public static final int hello=0x7f050000; public static final int hello=0x7f050000;
public static final int instructions=0x7f050003; public static final int instructions=0x7f050003;
public static final int url_help=0x7f050008;
public static final int url_label=0x7f050007; public static final int url_label=0x7f050007;
public static final int which_browser=0x7f050005; public static final int which_browser=0x7f050005;
} }

View File

@ -1,35 +1,61 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1" android:id="@+id/scrollView1"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_width="fill_parent"> android:layout_height="wrap_content" >
<LinearLayout <LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="30sp" android:paddingLeft="30sp"
android:paddingRight="30sp" android:paddingRight="30sp" >
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:scaleType="center"
android:src="@drawable/icon" />
<TextView <TextView
android:layout_width="fill_parent" android:layout_width="230dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="3"
android:text="@string/hello" android:text="@string/hello"
android:textSize="34sp" /> android:textSize="25sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/pageUrl_label" android:id="@+id/pageUrl_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/url_label" android:text="@string/url_label"
android:textSize="20sp" /> android:textSize="20sp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/url_help" />
<EditText <EditText
android:id="@+id/pocheUrl" android:id="@+id/pocheUrl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_weight="1"
android:ems="10" android:ems="10"
android:inputType="text" android:inputType="textFilter"
android:linksClickable="false" android:linksClickable="false"
android:maxLines="1" android:maxLines="1"
android:scrollHorizontally="false" > android:scrollHorizontally="false" >
@ -37,14 +63,38 @@
<requestFocus /> <requestFocus />
</EditText> </EditText>
<TextView android:id="@+id/instructions" android:layout_width="wrap_content" android:text="@string/instructions" android:layout_height="wrap_content" android:layout_marginTop="@dimen/toppadding" android:textSize="25sp" android:paddingTop="5sp" android:paddingBottom="30sp"></TextView> <TextView
android:id="@+id/instructions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/toppadding"
android:layout_weight="1"
android:paddingBottom="30sp"
android:paddingTop="5sp"
android:text="@string/instructions"
android:textSize="22sp" >
</TextView>
<Button
android:id="@+id/btnDone"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/btnDone" />
<TextView <TextView
android:id="@+id/author" android:id="@+id/author"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
android:text="@string/author" /> android:layout_weight="1"
android:text="@string/author"
android:textSize="10sp" />
<android.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button android:layout_width="wrap_content" android:id="@+id/btnDone" android:layout_height="wrap_content" android:text="@string/btnDone"></Button>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -3,9 +3,10 @@
<string name="hello">Welcome to Android2Poche !</string> <string name="hello">Welcome to Android2Poche !</string>
<string name="app_name">Android2Poche</string> <string name="app_name">Android2Poche</string>
<string name="author">By GAULUPEAU Jonathan</string> <string name="author">By GAULUPEAU Jonathan</string>
<string name="instructions">To save a web page to Poche, open the page in a browser then tap <i>Share</i> and tap on <i>Android to Poche</i>. You should then see a save window. When you have finished the browser will return to the original location.</string> <string name="instructions">To save a web page to Poche, open the page in a browser then tap <i>Share</i> and tap on <i>Android2Poche</i>. \nYou could then see your Poche login page. \nAnd it\'s done !</string>
<string name="btnDone">Done</string> <string name="btnDone">Done</string>
<string name="which_browser">Which browser would you like to use?</string> <string name="which_browser">Which browser would you like to use?</string>
<string name="authorSite">http://links.gaulupeau.fr</string> <string name="authorSite">http://links.gaulupeau.fr</string>
<string name="url_label">Your Poche URL :</string> <string name="url_label"><b><u>Your Poche URL :</u></b></string>
<string name="url_help">Examples:\n<i>http://poche.example.fr</i>\n<i>http://www.example.fr/poche</i></string>
</resources> </resources>

View File

@ -68,6 +68,7 @@ import android.widget.TextView;
e.printStackTrace(); e.printStackTrace();
} }
String base64 = Base64.encodeToString(data, Base64.DEFAULT); String base64 = Base64.encodeToString(data, Base64.DEFAULT);
System.out.println(base64);
deliciousSaveUrl.appendQueryParameter("url", base64); deliciousSaveUrl.appendQueryParameter("url", base64);
//System.out.println("base64 : " + base64); //System.out.println("base64 : " + base64);
//System.out.println("pageurl : " + pageUrl); //System.out.println("pageurl : " + pageUrl);
@ -92,7 +93,6 @@ import android.widget.TextView;
btnDone.setOnClickListener(new OnClickListener() { btnDone.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
// close the app // close the app
System.out.println(editPocheUrl.getText().toString());
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit(); SharedPreferences.Editor editor = settings.edit();
editor.putString("pocheUrl", editPocheUrl.getText().toString()); editor.putString("pocheUrl", editPocheUrl.getText().toString());