First batch of Material Design with complete new themes, styles and ActionBar drawables.
|
@ -1,18 +1,13 @@
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 19
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "21.1.2"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "be.digitalia.fosdem"
|
applicationId "be.digitalia.fosdem"
|
||||||
minSdkVersion 7
|
minSdkVersion 7
|
||||||
targetSdkVersion 19
|
targetSdkVersion 21
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -24,6 +19,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:20.0.+'
|
compile 'com.android.support:appcompat-v7:21.0.+'
|
||||||
compile 'com.github.chrisbanes.photoview:library:1.2.+'
|
// Version 1.2.3 has a bug and crashes when detecting 2-finger gestures. Use 1.2.2 instead.
|
||||||
|
compile 'com.github.chrisbanes.photoview:library:1.2.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,27 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest
|
||||||
package="be.digitalia.fosdem"
|
package="be.digitalia.fosdem"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="700110"
|
android:versionCode="700130"
|
||||||
android:versionName="1.1.0" >
|
android:versionName="1.3.0">
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="7"
|
android:minSdkVersion="7"
|
||||||
android:targetSdkVersion="19" />
|
android:targetSdkVersion="21"/>
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.NFC" />
|
<uses-permission android:name="android.permission.NFC"/>
|
||||||
|
|
||||||
<!-- Permissions required for alarms -->
|
<!-- Permissions required for alarms -->
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||||
|
|
||||||
<!-- Make touch screen optional since all screens can be used with a pad -->
|
<!-- Make touch screen optional since all screens can be used with a pad -->
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.touchscreen"
|
android:name="android.hardware.touchscreen"
|
||||||
android:required="false" />
|
android:required="false"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="be.digitalia.fosdem.FosdemApplication"
|
android:name="be.digitalia.fosdem.FosdemApplication"
|
||||||
|
@ -28,73 +29,74 @@
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme" >
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
android:label="@string/app_name" >
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.default_searchable"
|
android:name="android.app.default_searchable"
|
||||||
android:value=".activities.SearchResultActivity" />
|
android:value=".activities.SearchResultActivity"/>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activities.TrackScheduleActivity" >
|
<activity android:name=".activities.TrackScheduleActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value=".activities.MainActivity" />
|
android:value=".activities.MainActivity"/>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activities.TrackScheduleEventActivity" />
|
<activity android:name=".activities.TrackScheduleEventActivity"/>
|
||||||
<activity android:name=".activities.EventDetailsActivity" >
|
<activity android:name=".activities.EventDetailsActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
|
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
|
||||||
<data android:mimeType="application/be.digitalia.fosdem" />
|
<data android:mimeType="application/be.digitalia.fosdem"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activities.PersonInfoActivity" />
|
<activity android:name=".activities.PersonInfoActivity"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SearchResultActivity"
|
android:name=".activities.SearchResultActivity"
|
||||||
android:launchMode="singleTop" >
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
<action android:name="android.intent.action.SEARCH"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.searchable"
|
android:name="android.app.searchable"
|
||||||
android:resource="@xml/main_searchable" />
|
android:resource="@xml/main_searchable"/>
|
||||||
</activity>
|
</activity>
|
||||||
<!-- Clearing the Task Affinity allows this dialog activity to be displayed without bringing to front the main application with it. -->
|
<!-- Clearing the Task Affinity allows this dialog activity to be displayed without bringing to front the main application with it. -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.RoomImageDialogActivity"
|
android:name=".activities.RoomImageDialogActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:theme="@style/DialogTheme" />
|
android:theme="@style/DialogTheme"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
android:label="@string/settings" />
|
android:label="@string/settings"/>
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receivers.AlarmReceiver"
|
android:name=".receivers.AlarmReceiver"
|
||||||
android:exported="false" >
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".services.AlarmIntentService"
|
android:name=".services.AlarmIntentService"
|
||||||
android:exported="false" />
|
android:exported="false"/>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name=".providers.SearchSuggestionProvider"
|
android:name=".providers.SearchSuggestionProvider"
|
||||||
android:authorities="be.digitalia.fosdem.search"
|
android:authorities="be.digitalia.fosdem.search"
|
||||||
android:exported="true" />
|
android:exported="true"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -1,9 +1,5 @@
|
||||||
package be.digitalia.fosdem.activities;
|
package be.digitalia.fosdem.activities;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
@ -15,14 +11,16 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v4.app.ActionBarDrawerToggle;
|
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
|
@ -31,21 +29,31 @@ import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import be.digitalia.fosdem.R;
|
import be.digitalia.fosdem.R;
|
||||||
import be.digitalia.fosdem.api.FosdemApi;
|
import be.digitalia.fosdem.api.FosdemApi;
|
||||||
import be.digitalia.fosdem.db.DatabaseManager;
|
import be.digitalia.fosdem.db.DatabaseManager;
|
||||||
|
@ -63,11 +71,11 @@ import be.digitalia.fosdem.fragments.TracksFragment;
|
||||||
public class MainActivity extends ActionBarActivity implements ListView.OnItemClickListener {
|
public class MainActivity extends ActionBarActivity implements ListView.OnItemClickListener {
|
||||||
|
|
||||||
private enum Section {
|
private enum Section {
|
||||||
TRACKS(TracksFragment.class, R.string.menu_tracks, R.drawable.ic_action_event, true),
|
TRACKS(TracksFragment.class, R.string.menu_tracks, R.drawable.ic_event_grey600_24dp, true),
|
||||||
BOOKMARKS(BookmarksListFragment.class, R.string.menu_bookmarks, R.drawable.ic_action_important, false),
|
BOOKMARKS(BookmarksListFragment.class, R.string.menu_bookmarks, R.drawable.ic_bookmark_grey600_24dp, false),
|
||||||
LIVE(LiveFragment.class, R.string.menu_live, R.drawable.ic_action_play_over_video, false),
|
LIVE(LiveFragment.class, R.string.menu_live, R.drawable.ic_play_circle_outline_grey600_24dp, false),
|
||||||
SPEAKERS(PersonsListFragment.class, R.string.menu_speakers, R.drawable.ic_action_group, false),
|
SPEAKERS(PersonsListFragment.class, R.string.menu_speakers, R.drawable.ic_people_grey600_24dp, false),
|
||||||
MAP(MapFragment.class, R.string.menu_map, R.drawable.ic_action_map, false);
|
MAP(MapFragment.class, R.string.menu_map, R.drawable.ic_map_grey600_24dp, false);
|
||||||
|
|
||||||
private final String fragmentClassName;
|
private final String fragmentClassName;
|
||||||
private final int titleResId;
|
private final int titleResId;
|
||||||
|
@ -108,6 +116,7 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
|
|
||||||
private Section currentSection;
|
private Section currentSection;
|
||||||
|
|
||||||
|
private ProgressBar progressBar;
|
||||||
private DrawerLayout drawerLayout;
|
private DrawerLayout drawerLayout;
|
||||||
private ActionBarDrawerToggle drawerToggle;
|
private ActionBarDrawerToggle drawerToggle;
|
||||||
private View mainMenu;
|
private View mainMenu;
|
||||||
|
@ -120,8 +129,8 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
setSupportProgressBarIndeterminate(false);
|
progressBar.setIndeterminate(false);
|
||||||
setSupportProgress(intent.getIntExtra(FosdemApi.EXTRA_PROGRESS, 0) * 100);
|
progressBar.setProgress(intent.getIntExtra(FosdemApi.EXTRA_PROGRESS, 0));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -130,8 +139,10 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
// Hide the progress bar with a fill and fade out animation
|
// Hide the progress bar with a fill and fade out animation
|
||||||
setSupportProgressBarIndeterminate(false);
|
progressBar.setIndeterminate(false);
|
||||||
setSupportProgress(10000);
|
progressBar.setProgress(100);
|
||||||
|
progressBar.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, android.R.anim.fade_out));
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
int result = intent.getIntExtra(FosdemApi.EXTRA_RESULT, FosdemApi.RESULT_ERROR);
|
int result = intent.getIntExtra(FosdemApi.EXTRA_RESULT, FosdemApi.RESULT_ERROR);
|
||||||
String message;
|
String message;
|
||||||
|
@ -177,14 +188,18 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
supportRequestWindowFeature(Window.FEATURE_PROGRESS);
|
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
progressBar = (ProgressBar) findViewById(R.id.progress);
|
||||||
|
|
||||||
// Setup drawer layout
|
// Setup drawer layout
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
drawerLayout.setDrawerShadow(getResources().getDrawable(R.drawable.drawer_shadow), Gravity.LEFT);
|
drawerLayout.setDrawerShadow(getResources().getDrawable(R.drawable.drawer_shadow), Gravity.LEFT);
|
||||||
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.drawable.ic_drawer, R.string.main_menu, R.string.close_menu) {
|
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.main_menu, R.string.close_menu) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerOpened(View drawerView) {
|
public void onDrawerOpened(View drawerView) {
|
||||||
|
@ -277,7 +292,7 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
|
||||||
// Ensure the progress bar is hidden when starting
|
// Ensure the progress bar is hidden when starting
|
||||||
setSupportProgressBarVisibility(false);
|
progressBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
// Monitor the schedule download
|
// Monitor the schedule download
|
||||||
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
|
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
|
||||||
|
@ -390,8 +405,9 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public void startDownloadSchedule() {
|
public void startDownloadSchedule() {
|
||||||
// Start by displaying indeterminate progress, determinate will come later
|
// Start by displaying indeterminate progress, determinate will come later
|
||||||
setSupportProgressBarIndeterminate(true);
|
progressBar.clearAnimation();
|
||||||
setSupportProgressBarVisibility(true);
|
progressBar.setIndeterminate(true);
|
||||||
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||||
new DownloadScheduleAsyncTask(this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new DownloadScheduleAsyncTask(this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
} else {
|
} else {
|
||||||
|
@ -420,10 +436,18 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
|
|
||||||
private Section[] sections = Section.values();
|
private Section[] sections = Section.values();
|
||||||
private LayoutInflater inflater;
|
private LayoutInflater inflater;
|
||||||
|
private int currentSectionForegroundColor;
|
||||||
private int currentSectionBackgroundColor;
|
private int currentSectionBackgroundColor;
|
||||||
|
|
||||||
public MainMenuAdapter(LayoutInflater inflater) {
|
public MainMenuAdapter(LayoutInflater inflater) {
|
||||||
this.inflater = inflater;
|
this.inflater = inflater;
|
||||||
|
// Select the primary color to tint the current section
|
||||||
|
TypedArray a = getTheme().obtainStyledAttributes(new int[]{R.attr.colorPrimary});
|
||||||
|
try {
|
||||||
|
currentSectionForegroundColor = a.getColor(0, Color.TRANSPARENT);
|
||||||
|
} finally {
|
||||||
|
a.recycle();
|
||||||
|
}
|
||||||
currentSectionBackgroundColor = getResources().getColor(R.color.translucent_grey);
|
currentSectionBackgroundColor = getResources().getColor(R.color.translucent_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,10 +475,22 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
Section section = getItem(position);
|
Section section = getItem(position);
|
||||||
|
|
||||||
TextView tv = (TextView) convertView.findViewById(R.id.section_text);
|
TextView tv = (TextView) convertView.findViewById(R.id.section_text);
|
||||||
tv.setText(section.getTitleResId());
|
SpannableString sectionTitle = new SpannableString(getString(section.getTitleResId()));
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(section.getIconResId(), 0, 0, 0);
|
Drawable sectionIcon = getResources().getDrawable(section.getIconResId());
|
||||||
// Show highlighted background for current section
|
int backgroundColor;
|
||||||
tv.setBackgroundColor((section == currentSection) ? currentSectionBackgroundColor : Color.TRANSPARENT);
|
if (section == currentSection) {
|
||||||
|
// Special color for the current section
|
||||||
|
//sectionTitle.setSpan(new StyleSpan(Typeface.BOLD), 0, sectionTitle.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
sectionTitle.setSpan(new ForegroundColorSpan(currentSectionForegroundColor), 0, sectionTitle.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
// We need to mutate the drawable before applying the ColorFilter, or else all the similar drawable instances will be tinted.
|
||||||
|
sectionIcon.mutate().setColorFilter(currentSectionForegroundColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
backgroundColor = currentSectionBackgroundColor;
|
||||||
|
} else {
|
||||||
|
backgroundColor = Color.TRANSPARENT;
|
||||||
|
}
|
||||||
|
tv.setText(sectionTitle);
|
||||||
|
tv.setCompoundDrawablesWithIntrinsicBounds(sectionIcon, null, null, null);
|
||||||
|
tv.setBackgroundColor(backgroundColor);
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class EventsAdapter extends CursorAdapter {
|
||||||
}
|
}
|
||||||
spannableString.setSpan(holder.titleSizeSpan, 0, eventTitle.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
spannableString.setSpan(holder.titleSizeSpan, 0, eventTitle.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
holder.title.setText(spannableString);
|
holder.title.setText(spannableString);
|
||||||
int bookmarkDrawable = DatabaseManager.toBookmarkStatus(cursor) ? R.drawable.ic_small_starred : 0;
|
int bookmarkDrawable = DatabaseManager.toBookmarkStatus(cursor) ? R.drawable.ic_bookmark_grey600_24dp : 0;
|
||||||
holder.title.setCompoundDrawablesWithIntrinsicBounds(0, 0, bookmarkDrawable, 0);
|
holder.title.setCompoundDrawablesWithIntrinsicBounds(0, 0, bookmarkDrawable, 0);
|
||||||
|
|
||||||
holder.trackName.setText(event.getTrack().getName());
|
holder.trackName.setText(event.getTrack().getName());
|
||||||
|
|
|
@ -14,6 +14,7 @@ import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import be.digitalia.fosdem.R;
|
import be.digitalia.fosdem.R;
|
||||||
import be.digitalia.fosdem.activities.EventDetailsActivity;
|
import be.digitalia.fosdem.activities.EventDetailsActivity;
|
||||||
import be.digitalia.fosdem.adapters.EventsAdapter;
|
import be.digitalia.fosdem.adapters.EventsAdapter;
|
||||||
|
@ -26,7 +27,6 @@ import be.digitalia.fosdem.widgets.BookmarksMultiChoiceModeListener;
|
||||||
* Bookmarks list, optionally filterable.
|
* Bookmarks list, optionally filterable.
|
||||||
*
|
*
|
||||||
* @author Christophe Beyls
|
* @author Christophe Beyls
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class BookmarksListFragment extends ListFragment implements LoaderCallbacks<Cursor> {
|
public class BookmarksListFragment extends ListFragment implements LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
|
@ -75,7 +75,9 @@ public class BookmarksListFragment extends ListFragment implements LoaderCallbac
|
||||||
|
|
||||||
private void updateOptionsMenu() {
|
private void updateOptionsMenu() {
|
||||||
if (filterMenuItem != null) {
|
if (filterMenuItem != null) {
|
||||||
filterMenuItem.setIcon(upcomingOnly ? R.drawable.ic_action_filter_selected : R.drawable.ic_action_filter);
|
filterMenuItem.setIcon(upcomingOnly ?
|
||||||
|
R.drawable.ic_filter_list_selected_white_24dp
|
||||||
|
: R.drawable.ic_filter_list_white_24dp);
|
||||||
upcomingOnlyMenuItem.setChecked(upcomingOnly);
|
upcomingOnlyMenuItem.setChecked(upcomingOnly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package be.digitalia.fosdem.fragments;
|
package be.digitalia.fosdem.fragments;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -32,6 +28,11 @@ import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import be.digitalia.fosdem.R;
|
import be.digitalia.fosdem.R;
|
||||||
import be.digitalia.fosdem.activities.PersonInfoActivity;
|
import be.digitalia.fosdem.activities.PersonInfoActivity;
|
||||||
import be.digitalia.fosdem.db.DatabaseManager;
|
import be.digitalia.fosdem.db.DatabaseManager;
|
||||||
|
@ -201,10 +202,10 @@ public class EventDetailsFragment extends Fragment {
|
||||||
|
|
||||||
if (isBookmarked) {
|
if (isBookmarked) {
|
||||||
bookmarkMenuItem.setTitle(R.string.remove_bookmark);
|
bookmarkMenuItem.setTitle(R.string.remove_bookmark);
|
||||||
bookmarkMenuItem.setIcon(R.drawable.ic_action_important);
|
bookmarkMenuItem.setIcon(R.drawable.ic_bookmark_white_24dp);
|
||||||
} else {
|
} else {
|
||||||
bookmarkMenuItem.setTitle(R.string.add_bookmark);
|
bookmarkMenuItem.setTitle(R.string.add_bookmark);
|
||||||
bookmarkMenuItem.setIcon(R.drawable.ic_action_not_important);
|
bookmarkMenuItem.setIcon(R.drawable.ic_bookmark_outline_white_24dp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ public class TrackScheduleListFragment extends ListFragment implements Handler.C
|
||||||
spannableString.setSpan(holder.boldStyleSpan, 0, eventTitle.length() + personsSummary.length() + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
spannableString.setSpan(holder.boldStyleSpan, 0, eventTitle.length() + personsSummary.length() + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
holder.text.setText(spannableString);
|
holder.text.setText(spannableString);
|
||||||
int bookmarkDrawable = DatabaseManager.toBookmarkStatus(cursor) ? R.drawable.ic_small_starred : 0;
|
int bookmarkDrawable = DatabaseManager.toBookmarkStatus(cursor) ? R.drawable.ic_bookmark_grey600_24dp : 0;
|
||||||
holder.text.setCompoundDrawablesWithIntrinsicBounds(0, 0, bookmarkDrawable, 0);
|
holder.text.setCompoundDrawablesWithIntrinsicBounds(0, 0, bookmarkDrawable, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ public class AlarmIntentService extends IntentService {
|
||||||
PendingIntent mapPendingIntent = PendingIntent.getActivity(this, 0, mapIntent,
|
PendingIntent mapPendingIntent = PendingIntent.getActivity(this, 0, mapIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
CharSequence mapTitle = getString(R.string.room_map);
|
CharSequence mapTitle = getString(R.string.room_map);
|
||||||
notificationBuilder.addAction(new NotificationCompat.Action(R.drawable.ic_action_place, mapTitle,
|
notificationBuilder.addAction(new NotificationCompat.Action(R.drawable.ic_place_white_24dp, mapTitle,
|
||||||
mapPendingIntent));
|
mapPendingIntent));
|
||||||
// Use bigger action icon for wearable notification
|
// Use bigger action icon for wearable notification
|
||||||
wearableExtender.addAction(new NotificationCompat.Action(R.drawable.ic_place_white_wear, mapTitle,
|
wearableExtender.addAction(new NotificationCompat.Action(R.drawable.ic_place_white_wear, mapTitle,
|
||||||
|
|
Before Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 665 B |
Before Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 380 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 512 B |
After Width: | Height: | Size: 588 B |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 573 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 614 B |
BIN
app/src/main/res/drawable-hdpi/ic_bookmark_grey600_24dp.png
Normal file
After Width: | Height: | Size: 699 B |
After Width: | Height: | Size: 634 B |
BIN
app/src/main/res/drawable-hdpi/ic_bookmark_white_24dp.png
Normal file
After Width: | Height: | Size: 629 B |
BIN
app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 226 B |
BIN
app/src/main/res/drawable-hdpi/ic_directions_white_24dp.png
Normal file
After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 131 B |
BIN
app/src/main/res/drawable-hdpi/ic_event_add_white_24dp.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
app/src/main/res/drawable-hdpi/ic_event_grey600_24dp.png
Normal file
After Width: | Height: | Size: 183 B |
After Width: | Height: | Size: 274 B |
BIN
app/src/main/res/drawable-hdpi/ic_filter_list_white_24dp.png
Normal file
After Width: | Height: | Size: 136 B |
BIN
app/src/main/res/drawable-hdpi/ic_map_grey600_24dp.png
Normal file
After Width: | Height: | Size: 416 B |
BIN
app/src/main/res/drawable-hdpi/ic_people_grey600_24dp.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
app/src/main/res/drawable-hdpi/ic_place_white_24dp.png
Normal file
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 639 B |
BIN
app/src/main/res/drawable-hdpi/ic_public_white_24dp.png
Normal file
After Width: | Height: | Size: 623 B |
BIN
app/src/main/res/drawable-hdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 309 B |
BIN
app/src/main/res/drawable-hdpi/ic_sync_white_24dp.png
Normal file
After Width: | Height: | Size: 500 B |
Before Width: | Height: | Size: 138 B |
BIN
app/src/main/res/drawable-hdpi/list_focused_holo_dark.9.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
app/src/main/res/drawable-hdpi/list_focused_holo_light.9.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
app/src/main/res/drawable-hdpi/list_longpressed_holo_dark.9.png
Normal file
After Width: | Height: | Size: 115 B |
BIN
app/src/main/res/drawable-hdpi/list_longpressed_holo_light.9.png
Normal file
After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 113 B |
Before Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 806 B |
Before Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 489 B |
Before Width: | Height: | Size: 569 B |
Before Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 542 B |
Before Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 509 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 566 B |
Before Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 912 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 140 B |
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 316 B |