1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00

Network Dialogs layout changes + SignUp link background + Custom catalog examples

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1640 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
Vasiliy Bout 2010-08-02 12:28:23 +00:00
parent d729f6068d
commit d39563e28d
20 changed files with 216 additions and 235 deletions

View file

@ -7,7 +7,7 @@ DONE Комментарий к этому пункту = "Добавление O
** Какую-нибудь иконку к добавленным вручную каталогам
DONE Звездочку к 2-м обязательным пунктам при добавлении каталога
?? Убрать 3-й пункт при добавлении????
** Может быть сделать примеры мелким шрифтом под полями???
DONE Может быть сделать примеры мелким шрифтом под полями
** Сразу (по нажатию Ok) проверять и говорить, верный ли URL (Ex: Это не OPDS-каталог)
Это не должно мешать добавлению, но пользователь д.б. предупрежден
(типа -- это не OPDS каталог -> Edit/Continue/Cancel)

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" toBeTranslated="true" value="Title" />
<node name="catalogUrl" toBeTranslated="true" value="URL" />
<node name="catalogSummary" toBeTranslated="true" value="Summary" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" toBeTranslated="true" value="Title should be non-empty" />
<node name="urlIsEmpty" toBeTranslated="true" value="URL should be non-empty" />
<node name="invalidUrl" toBeTranslated="true" value="Invalid URL" />

View file

@ -315,6 +315,9 @@
<node name="catalogTitle" value="Title" />
<node name="catalogUrl" value="URL" />
<node name="catalogSummary" value="Summary" />
<node name="catalogTitleExample" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" value="Title should be non-empty" />
<node name="urlIsEmpty" value="URL should be non-empty" />
<node name="invalidUrl" value="Invalid URL" />

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" toBeTranslated="true" value="Title" />
<node name="catalogUrl" toBeTranslated="true" value="URL" />
<node name="catalogSummary" toBeTranslated="true" value="Summary" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" toBeTranslated="true" value="Title should be non-empty" />
<node name="urlIsEmpty" toBeTranslated="true" value="URL should be non-empty" />
<node name="invalidUrl" toBeTranslated="true" value="Invalid URL" />

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" toBeTranslated="true" value="Title" />
<node name="catalogUrl" toBeTranslated="true" value="URL" />
<node name="catalogSummary" toBeTranslated="true" value="Summary" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" toBeTranslated="true" value="Title should be non-empty" />
<node name="urlIsEmpty" toBeTranslated="true" value="URL should be non-empty" />
<node name="invalidUrl" toBeTranslated="true" value="Invalid URL" />

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" value="Titolo" />
<node name="catalogUrl" value="URL" />
<node name="catalogSummary" value="Sommario" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" value="Il campo Titolo non può essere lasciato vuoto" />
<node name="urlIsEmpty" value="Il campo URL non può essere lasciato vuoto" />
<node name="invalidUrl" value="URL non valida" />

View file

@ -315,6 +315,9 @@
<node name="catalogTitle" value="Название" />
<node name="catalogUrl" value="URL" />
<node name="catalogSummary" value="Описание" />
<node name="catalogTitleExample" value="Пример: Мой OPDS каталог" />
<node name="catalogUrlExample" value="Пример: http://my.library.address/opds" />
<node name="catalogSummaryExample" value="Пример: OPDS каталог моей библиотеки" />
<node name="titleIsEmpty" value="Название не может быть пустым" />
<node name="urlIsEmpty" value="URL не может быть пустым" />
<node name="invalidUrl" value="Неверный URL" />

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" toBeTranslated="true" value="Title" />
<node name="catalogUrl" toBeTranslated="true" value="URL" />
<node name="catalogSummary" toBeTranslated="true" value="Summary" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" toBeTranslated="true" value="Title should be non-empty" />
<node name="urlIsEmpty" toBeTranslated="true" value="URL should be non-empty" />
<node name="invalidUrl" toBeTranslated="true" value="Invalid URL" />

View file

@ -316,6 +316,9 @@
<node name="catalogTitle" toBeTranslated="true" value="Title" />
<node name="catalogUrl" toBeTranslated="true" value="URL" />
<node name="catalogSummary" toBeTranslated="true" value="Summary" />
<node name="catalogTitleExample" toBeTranslated="true" value="Example: My OPDS catalog" />
<node name="catalogUrlExample" toBeTranslated="true" value="Example: http://my.library.address/opds" />
<node name="catalogSummaryExample" toBeTranslated="true" value="Example: OPDS catalog for my library" />
<node name="titleIsEmpty" toBeTranslated="true" value="Title should be non-empty" />
<node name="urlIsEmpty" toBeTranslated="true" value="URL should be non-empty" />
<node name="invalidUrl" toBeTranslated="true" value="Invalid URL" />

6
icons/tree/link.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/link_pressed" />
<item android:state_focused="true" android:drawable="@drawable/link_selected" />
<item android:drawable="@drawable/link_default" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -7,54 +7,32 @@
android:paddingRight="10dp"
android:orientation="vertical"
>
<LinearLayout
<TextView
android:id="@+id/network_authentication_login_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingRight="12dp"
>
<TextView
android:id="@+id/network_authentication_login_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:paddingTop="12sp"
/>
<TextView
android:id="@+id/network_authentication_password_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
android:paddingTop="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<EditText
android:id="@+id/network_authentication_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<EditText
android:id="@+id/network_authentication_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
android:layout_marginTop="5dp"
/>
</LinearLayout>
</LinearLayout>
android:singleLine="true"
/>
<EditText
android:id="@+id/network_authentication_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<TextView
android:id="@+id/network_authentication_password_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_authentication_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
/>
<TextView
android:id="@+id/network_authentication_error"
android:layout_width="fill_parent"
@ -68,18 +46,19 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp"
android:paddingBottom="5dp"
>
<TextView
android:id="@+id/network_authentication_register"
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:singleLine="true"
android:textColor="#0000ff"
android:textStyle="bold"
android:clickable="true"
android:focusable="true"
android:background="@drawable/link"
/>
</LinearLayout>
</LinearLayout>

View file

@ -11,101 +11,102 @@
android:paddingRight="10dp"
android:orientation="vertical"
>
<LinearLayout
<TextView
android:id="@+id/network_catalog_title_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
<TextView
android:id="@+id/network_catalog_title_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingRight="12dp"
>
<TextView
android:id="@+id/network_catalog_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:maxLines="2"
/>
<TextView
android:id="@+id/network_catalog_url_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:maxLines="2"
/>
<TextView
android:id="@+id/network_catalog_summary_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:maxLines="2"
/>
</LinearLayout>
<LinearLayout
android:text="*"
android:textColor="#ffff0000"
android:layout_marginLeft="4dp"
android:layout_alignParentRight="true"
/>
<EditText
android:id="@+id/network_catalog_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/network_catalog_title_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
android:textColor="#ffff0000"
android:layout_marginLeft="4dp"
android:layout_alignParentRight="true"
/>
<EditText
android:id="@+id/network_catalog_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/network_catalog_title_star"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
>
<TextView
android:id="@+id/network_catalog_url_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
android:textColor="#ffff0000"
android:layout_marginLeft="4dp"
android:layout_alignParentRight="true"
/>
<EditText
android:id="@+id/network_catalog_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textUri"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/network_catalog_url_star"
/>
</RelativeLayout>
<EditText
android:id="@+id/network_catalog_summary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
</LinearLayout>
</LinearLayout>
android:singleLine="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/network_catalog_title_star"
/>
</RelativeLayout>
<TextView
android:id="@+id/network_catalog_title_example"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:gravity="right"
/>
<TextView
android:id="@+id/network_catalog_url_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/network_catalog_url_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
android:textColor="#ffff0000"
android:layout_marginLeft="4dp"
android:layout_alignParentRight="true"
/>
<EditText
android:id="@+id/network_catalog_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textUri"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/network_catalog_url_star"
/>
</RelativeLayout>
<TextView
android:id="@+id/network_catalog_url_example"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:gravity="right"
/>
<TextView
android:id="@+id/network_catalog_summary_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_catalog_summary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<TextView
android:id="@+id/network_catalog_summary_example"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:gravity="right"
/>
<TextView
android:id="@+id/network_catalog_error"
android:layout_width="fill_parent"

View file

@ -11,85 +11,59 @@
android:paddingRight="10dp"
android:orientation="vertical"
>
<LinearLayout
<TextView
android:id="@+id/network_register_login_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingRight="12dp"
>
<TextView
android:id="@+id/network_register_login_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:maxLines="2"
/>
<TextView
android:id="@+id/network_register_password_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:maxLines="2"
/>
<TextView
android:id="@+id/network_register_confirm_password_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:maxLines="2"
/>
<TextView
android:id="@+id/network_register_email_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:maxLines="2"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<EditText
android:id="@+id/network_register_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<EditText
android:id="@+id/network_register_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_register_confirm_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_register_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
</LinearLayout>
</LinearLayout>
android:singleLine="true"
/>
<EditText
android:id="@+id/network_register_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<TextView
android:id="@+id/network_register_password_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_register_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
/>
<TextView
android:id="@+id/network_register_confirm_password_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_register_confirm_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
/>
<TextView
android:id="@+id/network_register_email_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dp"
/>
<EditText
android:id="@+id/network_register_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
<TextView
android:id="@+id/network_register_error"
android:layout_width="fill_parent"

View file

@ -48,8 +48,8 @@ class AuthenticationDialog extends NetworkDialog {
public View createLayout() {
final View layout = myActivity.getLayoutInflater().inflate(R.layout.network_authentication_dialog, null);
setupLabel(layout, R.id.network_authentication_login_text, "login", R.id.network_authentication_login);
setupLabel(layout, R.id.network_authentication_password_text, "password", R.id.network_authentication_password);
((TextView) layout.findViewById(R.id.network_authentication_login_text)).setText(myResource.getResource("login").getValue());
((TextView) layout.findViewById(R.id.network_authentication_password_text)).setText(myResource.getResource("password").getValue());
final TextView registerText = (TextView) layout.findViewById(R.id.network_authentication_register);
registerText.setText(myResource.getResource("register").getValue());

View file

@ -53,9 +53,12 @@ class CustomCatalogDialog extends NetworkDialog {
protected View createLayout() {
final View layout = myActivity.getLayoutInflater().inflate(R.layout.network_custom_catalog_dialog, null);
setupLabel(layout, R.id.network_catalog_title_text, "catalogTitle", R.id.network_catalog_title);
setupLabel(layout, R.id.network_catalog_url_text, "catalogUrl", R.id.network_catalog_url);
setupLabel(layout, R.id.network_catalog_summary_text, "catalogSummary", R.id.network_catalog_summary);
((TextView) layout.findViewById(R.id.network_catalog_title_text)).setText(myResource.getResource("catalogTitle").getValue());
((TextView) layout.findViewById(R.id.network_catalog_url_text)).setText(myResource.getResource("catalogUrl").getValue());
((TextView) layout.findViewById(R.id.network_catalog_summary_text)).setText(myResource.getResource("catalogSummary").getValue());
((TextView) layout.findViewById(R.id.network_catalog_title_example)).setText(myResource.getResource("catalogTitleExample").getValue());
((TextView) layout.findViewById(R.id.network_catalog_url_example)).setText(myResource.getResource("catalogUrlExample").getValue());
((TextView) layout.findViewById(R.id.network_catalog_summary_example)).setText(myResource.getResource("catalogSummaryExample").getValue());
return layout;
}
@ -145,6 +148,11 @@ class CustomCatalogDialog extends NetworkDialog {
((TextView) dialog.findViewById(R.id.network_catalog_url)).setText((myUrl != null) ? myUrl : "");
((TextView) dialog.findViewById(R.id.network_catalog_summary)).setText((mySummary != null) ? mySummary : "");
final int examplesVisibility = (myLink == null) ? View.VISIBLE : View.GONE;
dialog.findViewById(R.id.network_catalog_title_example).setVisibility(examplesVisibility);
dialog.findViewById(R.id.network_catalog_url_example).setVisibility(examplesVisibility);
dialog.findViewById(R.id.network_catalog_summary_example).setVisibility(examplesVisibility);
final TextView error = (TextView) dialog.findViewById(R.id.network_catalog_error);
if (myErrorMessage == null) {
error.setVisibility(View.GONE);

View file

@ -28,8 +28,6 @@ import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.geometerplus.zlibrary.core.resources.ZLResource;
@ -187,13 +185,4 @@ abstract class NetworkDialog {
}
public abstract void prepareDialog(Dialog dialog);
protected void setupLabel(View layout, int labelId, String key, int labelForId) {
final View viewFor = layout.findViewById(labelForId);
viewFor.measure(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
final TextView label = (TextView) layout.findViewById(labelId);
label.setText(myResource.getResource(key).getValue());
label.getLayoutParams().height = viewFor.getMeasuredHeight();
}
}

View file

@ -54,10 +54,10 @@ class RegisterUserDialog extends NetworkDialog {
public View createLayout() {
final View layout = myActivity.getLayoutInflater().inflate(R.layout.network_register_user_dialog, null);
setupLabel(layout, R.id.network_register_login_text, "login", R.id.network_register_login);
setupLabel(layout, R.id.network_register_password_text, "password", R.id.network_register_password);
setupLabel(layout, R.id.network_register_confirm_password_text, "confirmPassword", R.id.network_register_confirm_password);
setupLabel(layout, R.id.network_register_email_text, "email", R.id.network_register_email);
((TextView) layout.findViewById(R.id.network_register_login_text)).setText(myResource.getResource("login").getValue());
((TextView) layout.findViewById(R.id.network_register_password_text)).setText(myResource.getResource("password").getValue());
((TextView) layout.findViewById(R.id.network_register_confirm_password_text)).setText(myResource.getResource("confirmPassword").getValue());
((TextView) layout.findViewById(R.id.network_register_email_text)).setText(myResource.getResource("email").getValue());
return layout;
}