Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some modifications #8

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 3 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
13 changes: 4 additions & 9 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,30 @@

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="13" />
android:targetSdkVersion="18" />

<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
<activity
android:name="MainActivity"
android:name="NewMainActivity"
android:hardwareAccelerated="false"
android:label="@string/app_name"
android:theme="@style/ViewerTheme"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="ViewActivity"
android:hardwareAccelerated="false"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/plain" />
<data android:mimeType="text/x-tex" />
<data android:mimeType="text/*" />
<data android:scheme="file" />
<data android:scheme="content" />
</intent-filter>
Expand Down
14 changes: 12 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
README
=======

Copyright (C) 2011-2012 Takahiro Yoshimura <[email protected]>
Copyright (C) 2011-2013 Takahiro Yoshimura <[email protected]>

This is a simple text-like file viewer application for the Android
platform. It is also my learning project.
Expand Down Expand Up @@ -34,10 +34,11 @@ It is available at: https://gist.github.com/1223663 .

Thanks to the jchardet project (http://jchardet.sourceforge.net/).

* 2 color themes
* 4 color themes

White-on-black (energy saving on OLED display, and eye saver under
dark conditions) and black-on-white are supported.
Update: Solarized Color theme (dark & light)

* Configurable font size

Expand All @@ -46,6 +47,10 @@ It is available at: https://gist.github.com/1223663 .
* Words-searching/finding

* Selectable/copyable text (only in Honeycomb or above)

* Now, it can choose text file from installed file manager

* Recent files


2. BUGS
Expand All @@ -64,3 +69,8 @@ Character set detection is done with the jchardet project

Word searching, text selection/copy feature is kindly contributed by
Renjaya Raga Zenta <[email protected]>.

Solarized Color: Precision colors for machines and people
(http://ethanschoonover.com/solarized)

Saving recent files use ObjectSerializer (https://github.com/apache/pig)
3 changes: 2 additions & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
proguard.config=etc/proguard/android.txt:etc/proguard/project.txt

# Project target.
target=android-17
target=android-18
android.library.reference.1=../../android-sdk-linux/extras/android/support/v7/appcompat
Binary file removed res/drawable-hdpi-v11/cancel.png
Binary file not shown.
Binary file removed res/drawable-hdpi-v11/next.png
Binary file not shown.
Binary file removed res/drawable-hdpi-v11/previous.png
Binary file not shown.
Binary file modified res/drawable-hdpi/cancel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/drawer_shadow.9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-hdpi/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-hdpi/previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed res/drawable-mdpi-v11/cancel.png
Binary file not shown.
Binary file removed res/drawable-mdpi-v11/next.png
Binary file not shown.
Binary file removed res/drawable-mdpi-v11/previous.png
Binary file not shown.
Binary file modified res/drawable-mdpi/cancel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/drawer_shadow.9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-mdpi/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-mdpi/previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 30 additions & 29 deletions res/layout-v11/main.xml → res/layout-v11/viewer.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" >

<TextView
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:longClickable="true"
android:paddingTop="?attr/actionBarSize"
android:text="@string/main_inst" />
</ScrollView>

<RelativeLayout
android:id="@+id/search"
style="?android:attr/actionBarStyle"
android:layout_width="fill_parent"
android:layout_height="?android:attr/actionBarSize"
style="?attr/actionBarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="#99000000"
android:gravity="center_vertical"
android:visibility="gone" >

<ImageButton
android:id="@+id/cancel"
style="?android:attr/borderlessButtonStyle"
style="?attr/buttonBarButtonStyle"
android:layout_width="48dip"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
Expand All @@ -27,11 +46,11 @@
android:layout_height="32dip"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/cancel"
android:background="?android:attr/dividerHorizontal" />
android:background="?attr/dividerHorizontal" />

<ImageButton
android:id="@+id/next"
style="?android:attr/borderlessButtonStyle"
style="?attr/buttonBarButtonStyle"
android:layout_width="48dip"
android:layout_height="match_parent"
android:layout_centerVertical="true"
Expand All @@ -44,11 +63,11 @@
android:layout_height="32dip"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/next"
android:background="?android:attr/dividerHorizontal" />
android:background="?attr/dividerHorizontal" />

<ImageButton
android:id="@+id/previous"
style="?android:attr/borderlessButtonStyle"
style="?attr/buttonBarButtonStyle"
android:layout_width="48dip"
android:layout_height="match_parent"
android:layout_centerVertical="true"
Expand All @@ -63,26 +82,8 @@
android:layout_centerVertical="true"
android:layout_margin="1dip"
android:layout_toLeftOf="@id/previous"
android:hint="@string/menu_title_main_search"
android:hint="@string/menu_title_viewer_search"
android:singleLine="true" />
</RelativeLayout>

<ScrollView
android:id="@+id/view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/search"
android:paddingTop="?android:attr/actionBarSize" >

<TextView
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:longClickable="true"
android:text="@string/main_inst" />
</ScrollView>

</RelativeLayout>
14 changes: 14 additions & 0 deletions res/layout/drawer_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:gravity="center_vertical"
android:minHeight="?attr/listPreferredItemHeightSmall"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingRight="?attr/listPreferredItemPaddingRight"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium" >

</TextView>
92 changes: 28 additions & 64 deletions res/layout/main.xml
Original file line number Diff line number Diff line change
@@ -1,66 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<RelativeLayout
android:id="@+id/search"
style="@android:style/ButtonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:visibility="gone" >

<ImageButton
android:id="@+id/cancel"
android:layout_width="48dip"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/cancel" />

<ImageButton
android:id="@+id/next"
android:layout_width="48dip"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/cancel"
android:src="@drawable/next" />

<ImageButton
android:id="@+id/previous"
android:layout_width="48dip"
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<Button
android:id="@+id/buttonBrowse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/next"
android:src="@drawable/previous" />

<EditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_margin="1dip"
android:layout_toLeftOf="@id/previous"
android:hint="@string/menu_title_main_search"
android:singleLine="true" />
</RelativeLayout>

<ScrollView
android:id="@+id/view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/search" >

<EditText
android:id="@+id/textview"
style="?android:attr/textViewStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:cursorVisible="false"
android:inputType="none"
android:longClickable="false"
android:text="@string/main_inst" />
</ScrollView>

</RelativeLayout>
android:layout_gravity="center"
android:text="@string/browse_file" >
</Button>
</FrameLayout>

<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111111"
android:choiceMode="singleChoice"
android:paddingTop="?attr/actionBarSize" />

</android.support.v4.widget.DrawerLayout>
Loading