Skip to content

Commit ef826f2

Browse files
author
Mahavir Jain
committed
merged PR #47
2 parents 699522c + 604cf60 commit ef826f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2406
-5549
lines changed

folioreader/AndroidManifest.xml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.folioreader">
4-
5-
<application>
6-
<activity android:name=".activity.HighlightListActivity" />
7-
<activity android:name=".activity.ContentHighlightActivity"></activity>
8-
</application>
9-
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.folioreader">
4+
5+
<application>
6+
<activity android:name=".activity.HighlightListActivity" />
7+
<activity android:name=".activity.ContentHighlightActivity" />
8+
</application>
9+
1010
</manifest>

folioreader/build.gradle

+28-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'checkstyle'
32
apply from: '../config/quality/quality.gradle'
43

54
ext {
@@ -54,37 +53,37 @@ android {
5453
targetCompatibility JavaVersion.VERSION_1_7
5554
}
5655

57-
packagingOptions {
58-
exclude 'META-INF/ASL2.0'
59-
exclude 'META-INF/DEPENDENCIES.txt'
60-
exclude 'META-INF/LICENSE.txt'
61-
exclude 'META-INF/NOTICE.txt'
62-
exclude 'META-INF/NOTICE'
63-
exclude 'META-INF/LICENSE'
64-
exclude 'META-INF/DEPENDENCIES'
65-
exclude 'META-INF/notice.txt'
66-
exclude 'META-INF/license.txt'
67-
exclude 'META-INF/dependencies.txt'
68-
exclude 'META-INF/LGPL2.1'
69-
exclude 'META-INF/services/javax.annotation.processing.Processor'
70-
}
56+
packagingOptions {
57+
exclude 'META-INF/ASL2.0'
58+
exclude 'META-INF/DEPENDENCIES.txt'
59+
exclude 'META-INF/LICENSE.txt'
60+
exclude 'META-INF/NOTICE.txt'
61+
exclude 'META-INF/NOTICE'
62+
exclude 'META-INF/LICENSE'
63+
exclude 'META-INF/DEPENDENCIES'
64+
exclude 'META-INF/notice.txt'
65+
exclude 'META-INF/license.txt'
66+
exclude 'META-INF/dependencies.txt'
67+
exclude 'META-INF/LGPL2.1'
68+
exclude 'META-INF/services/javax.annotation.processing.Processor'
69+
}
70+
71+
lintOptions {
72+
abortOnError false
73+
}
74+
75+
checkstyle {
76+
ignoreFailures = true
77+
}
7178
}
7279

7380
dependencies {
74-
compile fileTree(dir: 'libs', include: ['*.jar'])
75-
76-
//compile(name:'webViewMarker-release', ext:'aar')
81+
compile fileTree(include: ['*.jar'], dir: 'libs')
7782
compile project(':webViewMarker')
78-
compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'
79-
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
80-
compile 'com.j256.ormlite:ormlite-core:4.48'
81-
compile 'com.j256.ormlite:ormlite-android:4.48'
82-
compile "com.daimajia.swipelayout:library:1.2.0@aar"
83-
compile 'com.android.support:appcompat-v7:23.4.0'
84-
compile 'com.android.support:recyclerview-v7:23.4.0'
85-
compile 'com.android.support:support-v4:23.4.0'
83+
compile 'com.android.support:appcompat-v7:25.0.1'
84+
compile 'com.android.support:recyclerview-v7:25.0.1'
85+
compile 'com.android.support:support-v4:25.0.1'
86+
compile 'com.android.support:design:25.0.1'
8687
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
88+
compile 'com.squareup:otto:1.3.8'
8789
}
88-
89-
apply from: 'bintray/installv1.gradle'
90-
apply from: 'bintray/bintrayv1.gradle'
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
4-
xmlns:tools="http://schemas.android.com/tools"
5-
android:layout_width="match_parent"
6-
android:layout_height="match_parent"
7-
tools:context="com.folioreader.activity.ContentHighlightActivity">
8-
<android.support.v7.widget.Toolbar
9-
android:id="@+id/toolbar"
10-
android:layout_width="match_parent"
11-
android:layout_height="50dp"
12-
android:layout_margin="0dp"
13-
android:alpha="0.8"
14-
android:background="@color/white"
15-
android:contentInsetLeft="0dp"
16-
android:contentInsetRight="0dp"
17-
android:contentInsetStart="0dp"
18-
android:padding="0dp"
19-
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
20-
app:contentInsetEnd="0dp"
21-
app:contentInsetLeft="0dp"
22-
app:contentInsetRight="0dp"
23-
app:contentInsetStart="0dp">
24-
<RelativeLayout
25-
android:layout_width="match_parent"
26-
android:layout_height="match_parent">
27-
<ImageView
28-
android:id="@+id/btn_close"
29-
android:layout_width="wrap_content"
30-
android:layout_height="wrap_content"
31-
android:layout_alignParentLeft="true"
32-
android:layout_centerInParent="true"
33-
android:padding="20dp"
34-
android:scaleType="centerCrop"
35-
android:src="@drawable/ic_close_green" />
36-
<LinearLayout
37-
android:layout_width="170dp"
38-
android:layout_height="wrap_content"
39-
android:layout_centerHorizontal="true"
40-
android:layout_centerInParent="true"
41-
android:padding="1.8dp"
42-
android:background="@drawable/btn_contents_highlights"
43-
android:orientation="horizontal">
44-
<TextView
45-
android:id="@+id/btn_contents"
46-
android:layout_width="0dp"
47-
android:layout_height="match_parent"
48-
android:layout_weight="1"
49-
android:padding="5dp"
50-
android:gravity="center|end"
51-
android:background="@drawable/style_back_color_selector"
52-
android:text="@string/contents"
53-
android:textColor="@drawable/content_highlight_text_selector"
54-
android:textSize="16sp" />
55-
<TextView
56-
android:id="@+id/btn_highlights"
57-
android:layout_width="0dp"
58-
android:layout_height="match_parent"
59-
android:layout_weight="1"
60-
android:padding="5dp"
61-
android:background="@drawable/style_back_color_selector"
62-
android:gravity="center|start"
63-
android:text="@string/highlights"
64-
android:textColor="@drawable/content_highlight_text_selector"
65-
android:textSize="16sp" />
66-
</LinearLayout>
67-
<View
68-
android:id="@+id/view"
69-
android:layout_width="match_parent"
70-
android:layout_height="0.5dp"
71-
android:layout_alignParentBottom="true"
72-
android:background="@android:color/black" />
73-
</RelativeLayout>
74-
</android.support.v7.widget.Toolbar>
75-
<FrameLayout android:id="@+id/parent"
76-
android:layout_width="match_parent"
77-
android:layout_height="match_parent"
78-
android:layout_below="@id/toolbar">
79-
</FrameLayout>
80-
</RelativeLayout>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context="com.folioreader.activity.ContentHighlightActivity">
8+
<android.support.v7.widget.Toolbar
9+
android:id="@+id/toolbar"
10+
android:layout_width="match_parent"
11+
android:layout_height="50dp"
12+
android:layout_margin="0dp"
13+
android:alpha="0.8"
14+
android:background="@color/white"
15+
android:contentInsetLeft="0dp"
16+
android:contentInsetRight="0dp"
17+
android:contentInsetStart="0dp"
18+
android:padding="0dp"
19+
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
20+
app:contentInsetEnd="0dp"
21+
app:contentInsetLeft="0dp"
22+
app:contentInsetRight="0dp"
23+
app:contentInsetStart="0dp">
24+
<RelativeLayout
25+
android:layout_width="match_parent"
26+
android:layout_height="match_parent">
27+
<ImageView
28+
android:id="@+id/btn_close"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:layout_alignParentLeft="true"
32+
android:layout_centerInParent="true"
33+
android:padding="20dp"
34+
android:scaleType="centerCrop"
35+
android:src="@drawable/ic_close_green" />
36+
<LinearLayout
37+
android:layout_width="170dp"
38+
android:layout_height="wrap_content"
39+
android:layout_centerHorizontal="true"
40+
android:layout_centerInParent="true"
41+
android:padding="1.8dp"
42+
android:background="@drawable/btn_contents_highlights"
43+
android:orientation="horizontal">
44+
<TextView
45+
android:id="@+id/btn_contents"
46+
android:layout_width="0dp"
47+
android:layout_height="match_parent"
48+
android:layout_weight="1"
49+
android:padding="5dp"
50+
android:gravity="center|end"
51+
android:background="@drawable/style_back_color_selector"
52+
android:text="@string/contents"
53+
android:textColor="@drawable/content_highlight_text_selector"
54+
android:textSize="16sp" />
55+
<TextView
56+
android:id="@+id/btn_highlights"
57+
android:layout_width="0dp"
58+
android:layout_height="match_parent"
59+
android:layout_weight="1"
60+
android:padding="5dp"
61+
android:background="@drawable/style_back_color_selector"
62+
android:gravity="center|start"
63+
android:text="@string/highlights"
64+
android:textColor="@drawable/content_highlight_text_selector"
65+
android:textSize="16sp" />
66+
</LinearLayout>
67+
<View
68+
android:id="@+id/view"
69+
android:layout_width="match_parent"
70+
android:layout_height="0.5dp"
71+
android:layout_alignParentBottom="true"
72+
android:background="@android:color/black" />
73+
</RelativeLayout>
74+
</android.support.v7.widget.Toolbar>
75+
<FrameLayout android:id="@+id/parent"
76+
android:layout_width="match_parent"
77+
android:layout_height="match_parent"
78+
android:layout_below="@id/toolbar">
79+
</FrameLayout>
80+
</RelativeLayout>

folioreader/res/layout/folio_activity.xml

+5-15
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,12 @@
99
android:layout_width="match_parent"
1010
android:layout_height="match_parent"
1111
android:visibility="visible">
12-
<com.folioreader.view.FolioView
13-
android:id="@+id/folio_view"
12+
<com.folioreader.view.DirectionalViewpager
13+
android:id="@+id/folioPageViewPager"
1414
android:layout_width="match_parent"
15-
android:layout_height="match_parent" />
16-
<com.folioreader.view.AudioView
17-
android:id="@+id/audio_view"
18-
android:layout_width="match_parent"
19-
android:layout_height="wrap_content"
20-
android:layout_gravity="bottom"
21-
android:layout_alignParentBottom="true"/>
22-
<com.folioreader.view.ConfigView
23-
android:id="@+id/config_view"
24-
android:layout_width="match_parent"
25-
android:layout_height="wrap_content"
26-
android:layout_gravity="bottom"
27-
android:layout_alignParentBottom="true"/>
15+
app:direction="vertical"
16+
android:layout_height="match_parent">
17+
</com.folioreader.view.DirectionalViewpager>
2818
</RelativeLayout>
2919
<android.support.v7.widget.Toolbar
3020
android:id="@+id/toolbar"

folioreader/res/layout/row_highlight.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
android:text="20 sep 2016"
3737
android:textColor="@color/gray_text"
3838
android:textSize="14sp" />
39-
<com.folioreader.util.UnderlinedTextView
39+
<com.folioreader.view.UnderlinedTextView
4040
android:id="@+id/txt_hightlight_text"
4141
android:layout_width="wrap_content"
4242
android:layout_height="wrap_content"
@@ -61,7 +61,7 @@
6161
android:textColor="@color/black"
6262
android:textSize="14sp" />
6363

64-
<!-- <com.folioreader.util.UnderlinedTextView
64+
<!-- <com.folioreader.view.UnderlinedTextView
6565
android:id="@+id/txt_hightlight_text_underline"
6666
android:layout_width="wrap_content"
6767
android:layout_height="wrap_content"

folioreader/src/main/java/com/folioreader/Constants.java

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.folioreader;
22

3+
import com.squareup.otto.Bus;
4+
import com.squareup.otto.ThreadEnforcer;
5+
36
/**
47
* Created by mobisys on 10/4/2016.
58
*/

folioreader/src/main/java/com/folioreader/activity/ContentHighlightActivity.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.folioreader.fragments.ContentsFragment;
1515
import com.folioreader.fragments.HighlightListFragment;
1616
import com.folioreader.util.AppUtil;
17+
import com.folioreader.util.UiUtil;
1718

1819
import nl.siegmann.epublib.domain.Book;
1920

@@ -39,11 +40,11 @@ private void initViews() {
3940
((TextView) findViewById(R.id.btn_contents))
4041
.setBackgroundResource(R.drawable.content_highlight_back_selector_night_mode);
4142
((TextView) findViewById(R.id.btn_contents))
42-
.setTextColor(AppUtil.getColorList(this, R.color.black, R.color.app_green));
43+
.setTextColor(UiUtil.getColorList(ContentHighlightActivity.this, R.color.black, R.color.app_green));
4344
((TextView) findViewById(R.id.btn_highlights))
4445
.setBackgroundResource(R.drawable.content_highlight_back_selector_night_mode);
4546
((TextView) findViewById(R.id.btn_highlights))
46-
.setTextColor(AppUtil.getColorList(this, R.color.black, R.color.app_green));
47+
.setTextColor(UiUtil.getColorList(ContentHighlightActivity.this, R.color.black, R.color.app_green));
4748
}
4849

4950
loadContentFragment();
@@ -72,9 +73,9 @@ public void onClick(View v) {
7273
private void loadContentFragment() {
7374
findViewById(R.id.btn_contents).setSelected(true);
7475
findViewById(R.id.btn_highlights).setSelected(false);
75-
ContentsFragment contentFrameLayout = ContentsFragment.newInstance(mBook, mSelectedChapterPosition);
76+
ContentsFragment contentFrameLayout
77+
= ContentsFragment.newInstance(mBook, mSelectedChapterPosition);
7678
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
77-
//ft.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right);
7879
ft.replace(R.id.parent, contentFrameLayout);
7980
ft.commit();
8081
}
@@ -84,10 +85,7 @@ private void loadHighlightsFragment() {
8485
findViewById(R.id.btn_highlights).setSelected(true);
8586
HighlightListFragment highlightListFragment = HighlightListFragment.newInstance(mBook);
8687
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
87-
//ft.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left);
8888
ft.replace(R.id.parent, highlightListFragment);
8989
ft.commit();
9090
}
91-
92-
9391
}

0 commit comments

Comments
 (0)