mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Added gradients, modified count style.
This commit is contained in:
parent
9edb970c24
commit
e1484b47be
26 changed files with 210 additions and 207 deletions
|
@ -5,4 +5,20 @@ body {
|
|||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #d98800;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #b44a00;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
color: #bbb;
|
||||
border-left: 5px solid #ddd;
|
||||
padding-left: 15px;
|
||||
font-style: italic;
|
||||
margin-left: 10px;
|
||||
}
|
|
@ -13,3 +13,4 @@
|
|||
# Project target.
|
||||
target=android-14
|
||||
android.library.reference.1=../../../../workspace/ActionbarSherlock 4.1/library
|
||||
android.library.reference.2=../../../../../Android-SDK/extras/android/support/v7/gridlayout
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line" >
|
||||
<stroke
|
||||
android:dashGap="1dp"
|
||||
android:dashWidth="1dp"
|
||||
android:width="1dp"
|
||||
android:color="@color/darkgray" />
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/darkgray"/>
|
||||
|
||||
</shape>
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/lightgray" />
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/lightgray"/>
|
||||
</shape>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
|
||||
<solid android:color="@color/negative"/>
|
||||
<stroke android:width="0.5dp" android:color="@color/darkgray"/>
|
||||
</shape>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/negative"/>
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
|
||||
<solid android:color="@color/neutral" />
|
||||
<stroke android:width="0.5dp" android:color="@color/darkgray"/>
|
||||
</shape>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/neutral" />
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="@color/neutral" />
|
||||
</shape>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
|
||||
<solid android:color="@color/positive"/>
|
||||
<stroke android:width="0.5dp" android:color="@color/darkgray"/>
|
||||
</shape>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/positive"/>
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
6
media/android/NewsBlur/res/drawable/tag_background.xml
Normal file
6
media/android/NewsBlur/res/drawable/tag_background.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="6dp" />
|
||||
<stroke android:color="@color/lightgray" android:width="1dp" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
|
@ -1,17 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/reading_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_divider"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="8dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/orangeline_shadow" />
|
||||
|
||||
android:layout_height="1dip"
|
||||
android:layout_alignParentTop="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_floatbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/reading_divider"
|
||||
android:minHeight="8dp"
|
||||
android:alpha="0.8" />
|
||||
|
||||
<View
|
||||
android:id="@+id/reading_divider_bottom"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dip"
|
||||
android:layout_below="@id/reading_floatbar" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -2,20 +2,20 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/list_background"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/list_background">
|
||||
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/loading"
|
||||
android:textSize="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:layout_height="wrap_content"
|
||||
android:shadowColor="@color/darkgray"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="4" />
|
||||
|
||||
android:shadowRadius="15"
|
||||
android:text="@string/loading"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
|
@ -2,13 +2,13 @@
|
|||
<com.newsblur.view.NonfocusScrollview xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white" >
|
||||
android:background="@color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:paddingTop="9dp" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -16,52 +16,50 @@
|
|||
android:background="@drawable/list_background"
|
||||
android:padding="10dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reading_item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:shadowColor="@color/darkgray"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="15"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reading_item_authors"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/reading_item_title"
|
||||
android:gravity="center_vertical|right"
|
||||
android:minWidth="80dp"
|
||||
android:textColor="@color/lightgray"
|
||||
android:textSize="11dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reading_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginRight="80dp"
|
||||
android:layout_toLeftOf="@id/reading_item_authors"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reading_item_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@id/reading_item_title"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textColor="@color/lightgray"
|
||||
android:textSize="11dp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reading_item_tags"
|
||||
android:id="@+id/reading_item_counts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/reading_item_date"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/reading_item_date"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/reading_item_title"
|
||||
android:layout_below="@id/reading_item_date"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
|
@ -94,6 +92,17 @@
|
|||
android:layout_height="18dp"
|
||||
android:src="@drawable/favourite" />
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.GridLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/reading_item_tags"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/reading_item_date"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toLeftOf="@id/reading_item_counts"
|
||||
android:visibility="invisible"
|
||||
app:columnCount="5" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
|
@ -112,4 +121,5 @@
|
|||
android:layout_height="match_parent"
|
||||
android:scrollbars="none" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.newsblur.view.NonfocusScrollview>
|
|
@ -18,35 +18,38 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/row_feednegative"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/negative_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/negative_count_rect"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feedneutral"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/neutral_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/neutral_count_rect"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:padding="5dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feedpositive"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/positive_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/positive_count_rect"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/row_feedcounters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feednegative"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/negative_count_stripe"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:textSize="8dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feedneutral"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/neutral_count_stripe"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feedpositive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/positive_count_stripe"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_feedname"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@id/row_feedcounters"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/row_feedfavicon"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:alpha="0.7"
|
||||
android:contentDescription="@string/description_favicon" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -36,35 +36,38 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/row_foldersumneg"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/negative_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/negative_count_rect"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="7dp"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_foldersumneu"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/neutral_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/neutral_count_rect"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="7dp"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_foldersumpos"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:background="@drawable/positive_count_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/positive_count_rect"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="10dp"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="7dp"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
<?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="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:src="@drawable/tag" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tag_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/tag_background"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp" />
|
||||
|
||||
<android.support.v7.widget.Space
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="fill_parent" />
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,14 @@
|
|||
package com.newsblur.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
|
||||
public class ItemsList extends SherlockFragmentActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,6 @@ import android.view.Window;
|
|||
|
||||
import com.newsblur.R;
|
||||
import com.newsblur.fragment.LoginFragment;
|
||||
import com.newsblur.network.APIConstants;
|
||||
import com.newsblur.util.PrefConstants;
|
||||
|
||||
public class Login extends FragmentActivity implements LoginFragment.LoginFragmentInterface {
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.newsblur.activity;
|
|||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -10,6 +12,7 @@ import android.support.v4.app.Fragment;
|
|||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.actionbarsherlock.app.SherlockFragmentActivity;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
|
@ -24,6 +27,7 @@ import com.newsblur.domain.Story;
|
|||
import com.newsblur.service.DetachableResultReceiver;
|
||||
import com.newsblur.service.DetachableResultReceiver.Receiver;
|
||||
import com.newsblur.service.SyncService;
|
||||
import com.newsblur.util.UIUtils;
|
||||
|
||||
public class Reading extends SherlockFragmentActivity {
|
||||
|
||||
|
@ -41,8 +45,8 @@ public class Reading extends SherlockFragmentActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
requestWindowFeature(Window.FEATURE_PROGRESS);
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
|
||||
super.onCreate(savedInstanceBundle);
|
||||
setContentView(R.layout.activity_reading);
|
||||
|
||||
|
@ -51,15 +55,23 @@ public class Reading extends SherlockFragmentActivity {
|
|||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
readingAdapter = new ReadingAdapter(fragmentManager, this, feedId);
|
||||
|
||||
|
||||
contentResolver = getContentResolver();
|
||||
final Uri feedUri = FeedProvider.FEEDS_URI.buildUpon().appendPath(feedId).build();
|
||||
|
||||
feed = Feed.fromCursor(contentResolver.query(feedUri, null, null, null, null));
|
||||
setTitle(feed.title);
|
||||
|
||||
getSupportLoaderManager().initLoader(READING_LOADER , null, readingAdapter);
|
||||
GradientDrawable gradient = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, new int[] { Color.parseColor(feed.faviconColour), Color.parseColor(feed.faviconFade)});
|
||||
View view = findViewById(R.id.reading_floatbar);
|
||||
view.setBackgroundDrawable(gradient);
|
||||
|
||||
int border = Color.parseColor(feed.faviconBorder);
|
||||
findViewById(R.id.reading_divider).setBackgroundColor(border)
|
||||
; findViewById(R.id.reading_divider_bottom).setBackgroundColor(border);
|
||||
|
||||
getSupportLoaderManager().initLoader(READING_LOADER , null, readingAdapter);
|
||||
|
||||
syncFragment = (SyncReadingUpdaterFragment) fragmentManager.findFragmentByTag(SyncReadingUpdaterFragment.TAG);
|
||||
if (syncFragment == null) {
|
||||
syncFragment = new SyncReadingUpdaterFragment();
|
||||
|
@ -68,7 +80,12 @@ public class Reading extends SherlockFragmentActivity {
|
|||
}
|
||||
|
||||
pager = (ViewPager) findViewById(R.id.reading_pager);
|
||||
pager.setPageMargin(UIUtils.convertDPsToPixels(getApplicationContext(), 1));
|
||||
pager.setPageMarginDrawable(R.drawable.divider_light);
|
||||
|
||||
pager.setAdapter(readingAdapter);
|
||||
|
||||
|
||||
setProgressBarVisibility(true);
|
||||
}
|
||||
|
||||
|
@ -151,7 +168,9 @@ public class Reading extends SherlockFragmentActivity {
|
|||
switch (resultCode) {
|
||||
case SyncService.STATUS_FINISHED:
|
||||
Log.d(TAG, "Synchronisation finished.");
|
||||
((Reading) getActivity()).redrawUI();
|
||||
if (getActivity() != null) {
|
||||
((Reading) getActivity()).redrawUI();
|
||||
}
|
||||
break;
|
||||
case SyncService.STATUS_RUNNING:
|
||||
Log.d(TAG, "Synchronisation running.");
|
||||
|
|
|
@ -32,7 +32,8 @@ public class BlurDatabase extends SQLiteOpenHelper {
|
|||
DatabaseConstants.FEED_NEGATIVE_COUNT + INTEGER + ", " +
|
||||
DatabaseConstants.FEED_NEUTRAL_COUNT + INTEGER + ", " +
|
||||
DatabaseConstants.FEED_FAVICON + TEXT + ", " +
|
||||
DatabaseConstants.FEED_FAVICON_FADE + TEXT + ", " +
|
||||
DatabaseConstants.FEED_FAVICON_FADE + TEXT + ", " +
|
||||
DatabaseConstants.FEED_FAVICON_BORDER + TEXT + ", " +
|
||||
DatabaseConstants.FEED_LINK + TEXT + ", " +
|
||||
DatabaseConstants.FEED_SUBSCRIBERS + TEXT + ", " +
|
||||
DatabaseConstants.FEED_TITLE + TEXT + ", " +
|
||||
|
|
|
@ -17,6 +17,7 @@ public class DatabaseConstants {
|
|||
public static final String FEED_UPDATED_SECONDS = "updated_seconds";
|
||||
public static final String FEED_FAVICON_FADE = "favicon_fade";
|
||||
public static final String FEED_FAVICON_COLOUR = "favicon_colour";
|
||||
public static final String FEED_FAVICON_BORDER = "favicon_border";
|
||||
public static final String FEED_ACTIVE = "active";
|
||||
public static final String FEED_FAVICON = "favicon";
|
||||
public static final String FEED_POSITIVE_COUNT = "ps";
|
||||
|
@ -24,7 +25,7 @@ public class DatabaseConstants {
|
|||
public static final String FEED_NEGATIVE_COUNT = "ng";
|
||||
|
||||
public static final String[] FEED_COLUMNS = {
|
||||
FEED_ACTIVE, FEED_ID, FEED_TITLE, FEED_LINK, FEED_ADDRESS, FEED_SUBSCRIBERS, FEED_UPDATED_SECONDS, FEED_FAVICON_FADE, FEED_FAVICON_COLOUR,
|
||||
FEED_ACTIVE, FEED_ID, FEED_TITLE, FEED_LINK, FEED_ADDRESS, FEED_SUBSCRIBERS, FEED_UPDATED_SECONDS, FEED_FAVICON_FADE, FEED_FAVICON_COLOUR, FEED_FAVICON_BORDER,
|
||||
FEED_FAVICON, FEED_POSITIVE_COUNT, FEED_NEUTRAL_COUNT, FEED_NEGATIVE_COUNT
|
||||
};
|
||||
|
||||
|
|
|
@ -7,56 +7,60 @@ import com.google.gson.annotations.SerializedName;
|
|||
import com.newsblur.database.DatabaseConstants;
|
||||
|
||||
public class Feed {
|
||||
|
||||
|
||||
@SerializedName("id")
|
||||
public String feedId;
|
||||
|
||||
|
||||
@SerializedName("active")
|
||||
public boolean active;
|
||||
|
||||
|
||||
@SerializedName("feed_address")
|
||||
public String address;
|
||||
|
||||
|
||||
@SerializedName("favicon_color")
|
||||
public String faviconColour;
|
||||
|
||||
|
||||
@SerializedName("favicon_border")
|
||||
public String faviconBorder;
|
||||
|
||||
@SerializedName("favicon")
|
||||
public String favicon;
|
||||
|
||||
|
||||
@SerializedName("nt")
|
||||
public int neutralCount;
|
||||
|
||||
|
||||
@SerializedName("ng")
|
||||
public int negativeCount;
|
||||
|
||||
|
||||
@SerializedName("ps")
|
||||
public int positiveCount;
|
||||
|
||||
|
||||
@SerializedName("favicon_fade")
|
||||
public String faviconFade;
|
||||
|
||||
|
||||
@SerializedName("feed_link")
|
||||
public String feedLink;
|
||||
|
||||
|
||||
@SerializedName("num_subscribers")
|
||||
public String subscribers;
|
||||
|
||||
|
||||
@SerializedName("feed_title")
|
||||
public String title;
|
||||
|
||||
|
||||
@SerializedName("updated_seconds_ago")
|
||||
public String lastUpdated;
|
||||
|
||||
|
||||
public ContentValues getValues() {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(DatabaseConstants.FEED_ID, feedId);
|
||||
values.put(DatabaseConstants.FEED_ACTIVE, active);
|
||||
values.put(DatabaseConstants.FEED_ADDRESS, address);
|
||||
values.put(DatabaseConstants.FEED_FAVICON_COLOUR, faviconColour);
|
||||
values.put(DatabaseConstants.FEED_FAVICON_COLOUR, "#" + faviconColour);
|
||||
values.put(DatabaseConstants.FEED_FAVICON_BORDER, "#" + faviconBorder);
|
||||
values.put(DatabaseConstants.FEED_POSITIVE_COUNT, positiveCount);
|
||||
values.put(DatabaseConstants.FEED_NEUTRAL_COUNT, neutralCount);
|
||||
values.put(DatabaseConstants.FEED_NEGATIVE_COUNT, negativeCount);
|
||||
values.put(DatabaseConstants.FEED_FAVICON_FADE, faviconFade);
|
||||
values.put(DatabaseConstants.FEED_FAVICON_FADE, "#" + faviconFade);
|
||||
values.put(DatabaseConstants.FEED_FAVICON, favicon);
|
||||
values.put(DatabaseConstants.FEED_LINK, feedLink);
|
||||
values.put(DatabaseConstants.FEED_SUBSCRIBERS, subscribers);
|
||||
|
@ -73,6 +77,7 @@ public class Feed {
|
|||
feed.favicon = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_FAVICON));
|
||||
feed.faviconColour = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_FAVICON_COLOUR));
|
||||
feed.faviconFade = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_FAVICON_FADE));
|
||||
feed.faviconBorder = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_FAVICON_BORDER));
|
||||
feed.feedId = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_ID));
|
||||
feed.feedLink = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_LINK));
|
||||
feed.lastUpdated = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_UPDATED_SECONDS));
|
||||
|
@ -83,5 +88,5 @@ public class Feed {
|
|||
feed.title = childCursor.getString(childCursor.getColumnIndex(DatabaseConstants.FEED_TITLE));
|
||||
return feed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.newsblur.fragment;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.GridLayout;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -53,7 +54,7 @@ public class ReadingItemFragment extends Fragment {
|
|||
TextView itemAuthors = (TextView) view.findViewById(R.id.reading_item_authors);
|
||||
TextView itemCommentCount = (TextView) view.findViewById(R.id.reading_item_comment_count);
|
||||
TextView itemShareCount = (TextView) view.findViewById(R.id.reading_item_share_count);
|
||||
LinearLayout tagContainer = (LinearLayout) view.findViewById(R.id.reading_item_tags);
|
||||
GridLayout tagContainer = (GridLayout) view.findViewById(R.id.reading_item_tags);
|
||||
|
||||
if (story.tags != null || story.tags.length > 0) {
|
||||
tagContainer.setVisibility(View.VISIBLE);
|
||||
|
@ -82,6 +83,7 @@ public class ReadingItemFragment extends Fragment {
|
|||
web.getSettings().setAllowFileAccess(true);
|
||||
web.getSettings().setAppCacheEnabled(true);
|
||||
web.setVerticalScrollBarEnabled(false);
|
||||
web.setHorizontalScrollBarEnabled(false);
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
// TODO: Define a better strategy for rescaling the HTML across device screen sizes and storying this HTML as boilderplate somewhere
|
||||
|
|
|
@ -38,19 +38,19 @@ public class StateToggleButton extends LinearLayout implements OnClickListener {
|
|||
|
||||
imageStateOne = new ImageView(context);
|
||||
imageStateOne.setId(AppConstants.STATE_ALL);
|
||||
imageStateOne.setImageResource(R.drawable.negative_count_circle);
|
||||
imageStateOne.setImageResource(R.drawable.negative_count_rect);
|
||||
imageStateOne.setLayoutParams(new LayoutParams(length, length));
|
||||
|
||||
LayoutParams centerParams = new LayoutParams(length, length);
|
||||
centerParams.setMargins(marginSide, marginTop, marginSide, marginTop);
|
||||
imageStateTwo = new ImageView(context);
|
||||
imageStateTwo.setId(AppConstants.STATE_SOME);
|
||||
imageStateTwo.setImageResource(R.drawable.neutral_count_circle);
|
||||
imageStateTwo.setImageResource(R.drawable.neutral_count_rect);
|
||||
imageStateTwo.setLayoutParams(centerParams);
|
||||
|
||||
imageStateThree = new ImageView(context);
|
||||
imageStateThree.setId(AppConstants.STATE_BEST);
|
||||
imageStateThree.setImageResource(R.drawable.positive_count_circle);
|
||||
imageStateThree.setImageResource(R.drawable.positive_count_rect);
|
||||
imageStateThree.setLayoutParams(new LayoutParams(length, length));
|
||||
|
||||
imageStateOne.setOnClickListener(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue