Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: c99koder/lastfm-android
base: cae6af19f8
...
head fork: c99koder/lastfm-android
compare: b3e47ba241
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 8 files changed
  • 0 commit comments
  • 2 contributors
View
3  app/AndroidManifest.xml
@@ -28,7 +28,8 @@
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="10"/>
<application android:icon="@drawable/icon" android:label="@string/app_name"
- android:name="LastFMApplication" android:installLocation="internalOnly">
+ android:name="LastFMApplication" android:installLocation="internalOnly"
+ android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="LastFm" android:configChanges="keyboardHidden">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
View
2  app/src/fm/last/android/LastFm.java
@@ -43,7 +43,6 @@
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
-import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
@@ -75,7 +74,6 @@
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
SharedPreferences settings = getSharedPreferences(PREFS, 0);
String user = settings.getString("lastfm_user", "");
String session_key = settings.getString("lastfm_session_key", "");
View
2  app/src/fm/last/android/activity/Event.java
@@ -31,7 +31,6 @@
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
-import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.RadioGroup;
import android.widget.TextView;
@@ -86,7 +85,6 @@ private static int statusToResource(int status) {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.event);
mTitle = (TextView) findViewById(R.id.title);
View
2  app/src/fm/last/android/activity/Help.java
@@ -6,7 +6,6 @@
import fm.last.android.R;
import android.app.Activity;
import android.os.Bundle;
-import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@@ -17,7 +16,6 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.help);
mWebView = (WebView) findViewById(R.id.webview);
View
2  app/src/fm/last/android/activity/Metadata.java
@@ -39,7 +39,6 @@
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.Window;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
@@ -105,7 +104,6 @@ public Metadata() {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.metadata);
if(getIntent().getData() != null) {
View
2  app/src/fm/last/android/activity/Player.java
@@ -46,7 +46,6 @@
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.Window;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
@@ -103,7 +102,6 @@
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.audio_player);
setVolumeControlStream(android.media.AudioManager.STREAM_MUSIC);
View
63 app/src/fm/last/android/activity/Profile.java
@@ -23,10 +23,13 @@
import java.io.File;
import java.util.List;
+import android.accounts.Account;
+import android.accounts.AccountManager;
import android.app.ActivityGroup;
import android.app.AlertDialog;
import android.app.SearchManager;
import android.content.ComponentName;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -35,16 +38,16 @@
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
-import fm.last.android.utils.AsyncTaskEx;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.os.RemoteException;
+import android.provider.CalendarContract;
+import android.provider.ContactsContract;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
-import android.view.Window;
import android.widget.TabHost;
import fm.last.android.AndroidLastFmServerFactory;
import fm.last.android.LastFMApplication;
@@ -53,6 +56,7 @@
import fm.last.android.player.IRadioPlayer;
import fm.last.android.player.RadioPlayerService;
import fm.last.android.sync.AccountAuthenticatorService;
+import fm.last.android.utils.AsyncTaskEx;
import fm.last.api.LastFmServer;
import fm.last.api.Session;
import fm.last.api.SessionInfo;
@@ -80,7 +84,6 @@ public void onCreate(Bundle icicle) {
boolean isAuthenticatedUser = false;
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.home);
Session session = LastFMApplication.getInstance().session;
if (session == null || session.getName() == null || (Integer.decode(Build.VERSION.SDK) >= 6 && !AccountAuthenticatorService.hasLastfmAccount(this))) {
@@ -250,23 +253,69 @@ public void onServiceDisconnected(ComponentName comp) {
//Google Analytics doesn't appear to be thread safe
}
+ showSyncPrompts();
+
+ }
+
+ private void showSyncPrompts() {
if(Integer.decode(Build.VERSION.SDK) >= 6) {
SharedPreferences settings = getSharedPreferences(LastFm.PREFS, 0);
if(!settings.getBoolean("sync_nag", false) && !isHTCContactsInstalled(this)) {
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("sync_nag", true);
editor.commit();
- Intent intent = new Intent(Profile.this, ContactsSyncPrompt.class);
- startActivity(intent);
+ showContactSyncPrompt();
} else if(Integer.decode(Build.VERSION.SDK) >= 14 && !settings.getBoolean("sync_nag_cal", false)) {
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("sync_nag_cal", true);
editor.commit();
- Intent intent = new Intent(Profile.this, CalendarSyncPrompt.class);
- startActivity(intent);
+ showCalendarSyncPrompt();
}
}
+ }
+
+ private void showContactSyncPrompt() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.sync_prompt_title)
+ .setMessage(R.string.sync_prompt_body)
+ .setCancelable(false)
+ .setPositiveButton(R.string.common_yes, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ AccountManager am = AccountManager.get(Profile.this);
+ Account[] accounts = am.getAccountsByType(getString(R.string.ACCOUNT_TYPE));
+ ContentResolver.setIsSyncable(accounts[0], ContactsContract.AUTHORITY, 1);
+ ContentResolver.setSyncAutomatically(accounts[0], ContactsContract.AUTHORITY, true);
+ showSyncPrompts();
+ }
+ })
+ .setNegativeButton(R.string.common_no, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ showSyncPrompts();
+ }
+ });
+ builder.show();
+ }
+ private void showCalendarSyncPrompt() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.cal_sync_prompt_title)
+ .setMessage(R.string.cal_sync_prompt_body)
+ .setCancelable(false)
+ .setPositiveButton(R.string.common_yes, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ AccountManager am = AccountManager.get(Profile.this);
+ Account[] accounts = am.getAccountsByType(getString(R.string.ACCOUNT_TYPE));
+ ContentResolver.setIsSyncable(accounts[0], CalendarContract.AUTHORITY, 1);
+ ContentResolver.setSyncAutomatically(accounts[0], CalendarContract.AUTHORITY, true);
+ showSyncPrompts();
+ }
+ })
+ .setNegativeButton(R.string.common_no, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ showSyncPrompts();
+ }
+ });
+ builder.show();
}
@Override
View
2  app/src/fm/last/android/activity/SignUp.java
@@ -25,7 +25,6 @@
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
-import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
@@ -53,7 +52,6 @@ public void onClick(View v) {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.signup);
mUsername = (TextView) findViewById(R.id.username);

No commit comments for this range

Something went wrong with that request. Please try again.