Skip to content

Commit

Permalink
Fix scroll bug for about us activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussein Maher committed Dec 22, 2010
1 parent 387b2c8 commit 2d5243a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 64 deletions.
59 changes: 29 additions & 30 deletions gen/com/quran/labs/androidquran/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,35 @@ public static final class drawable {
public static final int translation=0x7f020008;
}
public static final class id {
public static final int bgPageview=0x7f070011;
public static final int btnEmailUs=0x7f070004;
public static final int btnHelpBack=0x7f070008;
public static final int cancelButton=0x7f07000a;
public static final int jumpButton=0x7f07000b;
public static final int linear=0x7f070000;
public static final int lstBookmarks=0x7f070005;
public static final int menu_item_about_us=0x7f070016;
public static final int menu_item_bookmarks=0x7f070018;
public static final int menu_item_bookmarks_add=0x7f07001a;
public static final int menu_item_bookmarks_remove=0x7f07001b;
public static final int menu_item_bookmarks_view=0x7f070019;
public static final int menu_item_help=0x7f07001d;
public static final int menu_item_jump=0x7f070015;
public static final int menu_item_settings=0x7f070017;
public static final int menu_item_translations=0x7f07001c;
public static final int pageScrollView=0x7f070013;
public static final int page_field=0x7f070009;
public static final int page_info=0x7f07000f;
public static final int pageview=0x7f070012;
public static final int splashview=0x7f070014;
public static final int sura_info=0x7f07000e;
public static final int sura_title=0x7f07000d;
public static final int suralist=0x7f07000c;
public static final int translationText=0x7f070010;
public static final int txtAbout=0x7f070001;
public static final int txtCopyRights=0x7f070003;
public static final int txtDevelopedBy=0x7f070002;
public static final int txtHelp=0x7f070007;
public static final int txtHelpTitle=0x7f070006;
public static final int bgPageview=0x7f070010;
public static final int btnEmailUs=0x7f070002;
public static final int btnHelpBack=0x7f070007;
public static final int cancelButton=0x7f070009;
public static final int jumpButton=0x7f07000a;
public static final int lstBookmarks=0x7f070004;
public static final int menu_item_about_us=0x7f070015;
public static final int menu_item_bookmarks=0x7f070017;
public static final int menu_item_bookmarks_add=0x7f070019;
public static final int menu_item_bookmarks_remove=0x7f07001a;
public static final int menu_item_bookmarks_view=0x7f070018;
public static final int menu_item_help=0x7f07001c;
public static final int menu_item_jump=0x7f070014;
public static final int menu_item_settings=0x7f070016;
public static final int menu_item_translations=0x7f07001b;
public static final int pageScrollView=0x7f070012;
public static final int page_field=0x7f070008;
public static final int page_info=0x7f07000e;
public static final int pageview=0x7f070011;
public static final int splashview=0x7f070013;
public static final int sura_info=0x7f07000d;
public static final int sura_title=0x7f07000c;
public static final int suralist=0x7f07000b;
public static final int translationText=0x7f07000f;
public static final int txtAbout=0x7f070003;
public static final int txtCopyRights=0x7f070001;
public static final int txtDevelopedBy=0x7f070000;
public static final int txtHelp=0x7f070006;
public static final int txtHelpTitle=0x7f070005;
}
public static final class layout {
public static final int about_us=0x7f030000;
Expand Down
32 changes: 13 additions & 19 deletions res/layout/about_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/list">

<LinearLayout android:id="@+id/linear"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:orientation="vertical" android:paddingBottom="5dip">
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:visibility="visible"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" android:textStyle="bold" android:id="@+id/txtAbout"
android:singleLine="false" android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" android:text="@string/aboutUs"
android:padding="10dip" android:lineSpacingExtra="4dip" />
</LinearLayout>

<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:linksClickable="true"
android:id="@+id/txtDevelopedBy" android:text="@string/developedBy"
Expand All @@ -27,12 +14,19 @@
android:id="@+id/txtCopyRights" android:text="@string/copyRights"
android:textSize="12dip" android:layout_above="@id/txtDevelopedBy"
android:textColor="#FFFFFF" android:paddingLeft="10dip" />

<Button android:layout_width="300dip" android:layout_height="20px"
android:id="@+id/btnEmailUs" android:text="Email Quran Android"
android:layout_centerHorizontal="true"
android:layout_below="@id/linear"
android:layout_above="@id/txtCopyRights"

<Button android:layout_width="300dip" android:id="@+id/btnEmailUs"
android:layout_height="wrap_content" android:text="Email Quran Android"
android:layout_centerHorizontal="true" android:layout_above="@id/txtCopyRights"
android:visibility="visible" />

<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:visibility="visible"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" android:textStyle="bold" android:id="@+id/txtAbout"
android:singleLine="false" android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" android:text="@string/aboutUs"
android:layout_above="@id/btnEmailUs" android:padding="10dip"
android:lineSpacingExtra="4dip" />

</RelativeLayout>
24 changes: 9 additions & 15 deletions src/com/quran/labs/androidquran/AboutUsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,20 @@ public void onCreate(Bundle savedInstanceState) {
txtAbout = (TextView)findViewById(R.id.txtAbout);
txtAbout.setVerticalScrollBarEnabled(true);
txtAbout.setMovementMethod(new ScrollingMovementMethod());

if (getWindowManager().getDefaultDisplay().getHeight() <
getWindowManager().getDefaultDisplay().getWidth())
txtAbout.setMaxLines(6);
else
txtAbout.setMaxLines(16);
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnEmailUs:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{getString(R.string.email_to)});
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
break;
default:
break;
case R.id.btnEmailUs:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{getString(R.string.email_to)});
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
break;
default:
break;
}
}
}

0 comments on commit 2d5243a

Please sign in to comment.