Skip to content

Commit

Permalink
Add swipecell
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Jul 25, 2015
1 parent a930e8d commit 751082e
Show file tree
Hide file tree
Showing 26 changed files with 993 additions and 135 deletions.
9 changes: 5 additions & 4 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.iscanner.iscanner_android"
android:versionCode="1"
android:versionName="1.0" >
android:versionName="1.2.0" >
<uses-sdk
android:minSdkVersion="19"
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Expand Down
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
iscanner_android
================
iScanner
========

iscanner android
An easy-to-use scanner app for android.

## Installation

Installation instructions are [on the homepage](http://iscanner.github.io/).

## Features

- fast simple and exact
- support multiple 2D codes
- easily receive codes with a alert, including the result string
- create qrcode from the results in history
- copy result to system clipboard
- store last three days items in the local
- completely open source under MIT agreement

## Screenshot

<img src="https://raw.githubusercontent.com/iscanner/iscanner_android/master/screenshot/launch.png" width="50%"/>
<img src="https://raw.githubusercontent.com/iscanner/iscanner_android/master/screenshot/scan.png" width="50%"/>
<img src="https://raw.githubusercontent.com/iscanner/iscanner_android/master/screenshot/history.png" width="50%"/>
<img src="https://raw.githubusercontent.com/iscanner/iscanner_android/master/screenshot/copy.png" width="50%"/>
<img src="https://raw.githubusercontent.com/iscanner/iscanner_android/master/screenshot/create.png" width="50%"/>


Thanks to:

- [zxing](https://github.com/zxing/zxing)
- [iscanner_ios](https://github.com/iscanner/iscanner_ios)

## License

The MIT License (MIT)

Copyright (c) 2014 xdf
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19
target=android-14
Binary file added res/drawable-hdpi/copy.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/qrcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 16 additions & 3 deletions res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,25 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="14dp"
android:layout_marginBottom="18dp"
android:gravity="center_vertical|center"
android:text="@string/copyright_content"
android:textColor="#0074ea" />
android:textColor="@color/grey" />
<Button
android:id="@+id/button_update"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="center_vertical|center"
android:background="@color/transparent"
android:layout_marginBottom="0dp"
android:height="20dp"
android:textSize="14sp"
android:text="@string/check_for_update"
android:textColor="@color/lightgrey" />
<ImageView
android:id="@+id/icon"
android:contentDescription="@string/app_name"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_alignParentTop="true"
Expand Down
45 changes: 34 additions & 11 deletions res/layout/activity_history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,40 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.github.iscanner.iscanner_android.MainActivity" >
<ListView
tools:context=".MainActivity" >
<com.github.iscanner.iscanner_android.SwipeableCell
android:id="@+id/historyListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" >
</ListView>
android:layout_height="match_parent"
android:layout_above="@+id/qr_dialog"
android:divider="#dddbdb"
android:dividerHeight="1dp" >
</com.github.iscanner.iscanner_android.SwipeableCell>
<RelativeLayout
android:id="@+id/qr_dialog"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/black"
android:visibility="gone" >
<ImageView
android:id="@+id/qr_image_view"
android:contentDescription="@string/app_name"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@color/white"
android:scaleType="centerInside"
android:src="@drawable/ic_logo"
android:visibility="visible" />
<TextView
android:id="@+id/tip_text"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/qr_image_view"
android:gravity="center_vertical|center"
android:text="@string/tip_content"
android:textColor="@color/white" />
</RelativeLayout>
</RelativeLayout>
56 changes: 56 additions & 0 deletions res/layout/cell_body.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/cell_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:paddingLeft="15dp"
android:paddingRight="15dp" >
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:height="60dp"
android:textColor="@color/grey" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/item_right"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<Button
android:id="@+id/create_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@color/lightgray"
android:drawableLeft="@drawable/qrcode"
android:focusable="false"
android:height="60dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="@string/create"
android:textColor="@color/white"
android:width="100dp" />
<Button
android:id="@+id/copy_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@color/grey"
android:drawableLeft="@drawable/copy"
android:focusable="false"
android:height="60dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="@string/copy"
android:textColor="@color/white"
android:width="100dp" />
</RelativeLayout>
</LinearLayout>
23 changes: 23 additions & 0 deletions res/layout/cell_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/cell_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cell_header"
android:paddingLeft="15dp"
android:paddingRight="15dp" >
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:height="25dp"
android:textColor="@color/black" />
</RelativeLayout>
</LinearLayout>
9 changes: 5 additions & 4 deletions res/layout/title.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:id="@+id/title_layout"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#00000000"
android:background="@color/transparent"
android:gravity="center_vertical|left"
android:paddingLeft="10dp"
android:text="@string/back_name"
android:textColor="#0074ea"
android:textColor="@color/title_button"
android:visibility="invisible" />
<TextView
android:id="@+id/title"
Expand All @@ -30,10 +31,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="#00000000"
android:background="@color/transparent"
android:gravity="center_vertical|right"
android:paddingRight="10dp"
android:text="@string/history_name"
android:textColor="#0074ea"
android:textColor="@color/title_button"
android:visibility="invisible" />
</RelativeLayout>
7 changes: 1 addition & 6 deletions res/values-v11/styles.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light"> <!-- API 11 theme customizations can go here. -->
<item name="android:windowActionBar">false</item>
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<item name="android:windowTitleSize">50dip</item>
<item name="android:windowAnimationStyle">@style/activityAnimation</item>
</style>
Expand Down
8 changes: 1 addition & 7 deletions res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> <!-- API 14 theme customizations can go here. -->
<item name="android:windowActionBar">false</item>
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:windowTitleSize">50dip</item>
<item name="android:windowAnimationStyle">@style/activityAnimation</item>
</style>
Expand Down
45 changes: 15 additions & 30 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>

<color name="bg_color">#EDEDED</color>
<color name="contents_text">#ff000000</color>
<color name="encode_view">#ffffffff</color>
<color name="help_button_view">#ffcccccc</color>
<color name="help_view">#ff404040</color>
<color name="possible_result_points">#c0ffff00</color>
<color name="result_image_border">#ffffffff</color>
<color name="result_minor_text">#ffc0c0c0</color>
<color name="result_points">#c000ff00</color>
<color name="result_text">#ffffffff</color>
<color name="result_view">#b0000000</color>
<color name="sbc_header_text">#ff808080</color>
<color name="sbc_header_view">#ffffffff</color>
<color name="sbc_list_item">#fffff0e0</color>
<color name="sbc_layout_view">#ffffffff</color>
<color name="sbc_page_number_text">#ff000000</color>
<color name="sbc_snippet_text">#ff4b4b4b</color>
<color name="share_text">#ff000000</color>
<color name="share_view">#ffffffff</color>
<color name="status_view">#50000000</color>
<color name="status_text">#ffffffff</color>
<color name="transparent">#00000000</color>
<color name="viewfinder_frame">#ff000000</color>
<color name="viewfinder_laser">#ffff0000</color>
<color name="viewfinder_mask">#10000000</color>
<color name="header">#58567D</color>
<color name="grgray">#686868</color>

</resources>
<color name="possible_result_points">#c0ffff00</color>
<color name="result_view">#b0000000</color>
<color name="transparent">#00000000</color>
<color name="viewfinder_frame">#ff000000</color>
<color name="viewfinder_laser">#ffff0000</color>
<color name="viewfinder_mask">#10000000</color>
<color name="dialog_background">#000000</color>
<color name="grey">#666666</color>
<color name="lightgrey">#888888</color>
<color name="white">#ffffff</color>
<color name="black">#000000</color>
<color name="lightgray">#aaaaaa</color>
<color name="cell_header">#ededed</color>
<color name="title_button">#0074ea</color>
</resources>
6 changes: 5 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<string name="app_name">iScanner</string>
<string name="back_name">back</string>
<string name="history_name">history</string>
<string name="copyright_content">iScanner v1.0\nby xdf</string>
<string name="copyright_content">iScanner by xdf</string>
<string name="action_settings">Settings</string>
<string name="tip_content">tap to close or screenshot</string>
<string name="create">create</string>
<string name="copy">copy</string>
<string name="check_for_update">update?</string>
</resources>
19 changes: 7 additions & 12 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light"> <!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Applicat ion theme. -->
<style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. -->
<style name="AppBaseTheme" parent="android:Theme.Light"></style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowActionBar">false</item>
<item name="android:windowTitleSize">50dip</item>
<item name="android:windowAnimationStyle">@style/activityAnimation</item>
Expand All @@ -21,4 +11,9 @@
<item name="android:activityCloseEnterAnimation">@anim/slide_left_in</item>
<item name="android:activityCloseExitAnimation">@anim/slide_right_out</item>
</style>
<style name="Dialog_Fullscreen">
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/dialog_background</item>
</style>
</resources>
Binary file added screenshot/copy.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 screenshot/create.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 screenshot/history.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 screenshot/launch.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 screenshot/scan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 751082e

Please sign in to comment.