From ffe81d0745736b4d64134157e5f7b5f7b6b5c8fc Mon Sep 17 00:00:00 2001 From: Robert Rowe Date: Mon, 2 Jan 2017 15:42:00 -0800 Subject: [PATCH 1/8] Basic service and notification shit --- app/src/main/AndroidManifest.xml | 12 +- .../java/io/r_a_d/radio/ActivityMain.java | 84 +++-------- .../java/io/r_a_d/radio/RadioService.java | 140 ++++++++++++++++++ app/src/main/res/drawable/lollipop_logo.png | Bin 0 -> 1687 bytes 4 files changed, 166 insertions(+), 70 deletions(-) create mode 100644 app/src/main/java/io/r_a_d/radio/RadioService.java create mode 100644 app/src/main/res/drawable/lollipop_logo.png diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e8723a..b430119 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,17 +15,19 @@ + android:configChanges="orientation|keyboardHidden" + android:launchMode="singleInstance"> - + + \ No newline at end of file diff --git a/app/src/main/java/io/r_a_d/radio/ActivityMain.java b/app/src/main/java/io/r_a_d/radio/ActivityMain.java index 844e9fd..0657167 100644 --- a/app/src/main/java/io/r_a_d/radio/ActivityMain.java +++ b/app/src/main/java/io/r_a_d/radio/ActivityMain.java @@ -4,11 +4,9 @@ import android.content.Intent; import android.graphics.Rect; import android.net.Uri; -import android.net.wifi.WifiManager; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.os.PowerManager; import android.support.design.widget.TabLayout; import android.support.v4.content.res.ResourcesCompat; import android.support.v4.graphics.drawable.RoundedBitmapDrawable; @@ -26,41 +24,22 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import com.google.android.exoplayer2.DefaultLoadControl; -import com.google.android.exoplayer2.ExoPlayerFactory; -import com.google.android.exoplayer2.LoadControl; -import com.google.android.exoplayer2.SimpleExoPlayer; -import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; -import com.google.android.exoplayer2.extractor.ExtractorsFactory; -import com.google.android.exoplayer2.source.ExtractorMediaSource; -import com.google.android.exoplayer2.source.MediaSource; -import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; -import com.google.android.exoplayer2.trackselection.TrackSelector; -import com.google.android.exoplayer2.upstream.DataSource; -import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; -import com.google.android.exoplayer2.util.Util; - import java.util.HashMap; public class ActivityMain extends AppCompatActivity implements ViewPager.OnPageChangeListener{ - private boolean playing = false; private boolean songChanged = false; private boolean firstSearchClick = true; - private SimpleExoPlayer sep; private Integer api_update_delay = 10000; private final Integer UPDATE_INTERVAL = 500; private ViewPager viewPager; private JSONScraperTask jsonTask = new JSONScraperTask(this, 0); - private Integer ui_page_to_update = 0; private DJImageTask djimageTask = new DJImageTask(this); - private String radio_url = "https://stream.r-a-d.io/main.mp3"; private String api_url = "https://r-a-d.io/api"; private String djimage_api = "https://r-a-d.io/api/dj-image/"; private String news_api_url = "https://r-a-d.io/api/news/"; @@ -70,10 +49,7 @@ public class ActivityMain extends AppCompatActivity implements ViewPager.OnPageC private final Object lock = new Object(); private HashMap songTimes; - private PowerManager powerManager; - private PowerManager.WakeLock wakeLock; - private WifiManager wifiManager; - private WifiManager.WifiLock wifiLock; + private boolean playing = false; private Handler handler = new Handler(){ @Override @@ -88,11 +64,6 @@ public void handleMessage(Message msg){ protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); - - powerManager = (PowerManager) getSystemService(POWER_SERVICE); - wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "KilimDankLock"); - wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); - wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "KilimDankWifiLock"); setContentView(R.layout.homescreen); songTimes = new HashMap<>(); @@ -107,7 +78,6 @@ protected void onCreate(Bundle savedInstanceState) { scrapeNews(news_api_url); scrapeJSON(api_url); - createMediaPlayer(); handler.postDelayed(new Runnable(){ public void run(){ @@ -130,14 +100,14 @@ public void run() { @Override protected void onDestroy() { super.onDestroy(); - sep.stop(); - sep.release(); - sep = null; - releaseWakeLocks(); if(songCalcThread.isAlive() && !songCalcThread.isInterrupted()) songCalcThread.interrupt(); } + @Override + protected void onResume() { + super.onResume(); + } @Override public void onPageSelected(int position) { @@ -176,21 +146,6 @@ public void onPageScrollStateChanged(int state) { return; } - public void createMediaPlayer() { - TrackSelector tSelector = new DefaultTrackSelector(); - LoadControl lc = new DefaultLoadControl(); - sep = ExoPlayerFactory.newSimpleInstance(this, tSelector, lc); - } - - public void setupMediaPlayer() { - DataSource.Factory dsf = new DefaultDataSourceFactory(this, - Util.getUserAgent(this, "R/a/dio-Android-App")); - ExtractorsFactory extractors = new DefaultExtractorsFactory(); - MediaSource audioSource = new ExtractorMediaSource(Uri.parse(radio_url), dsf, extractors, null, null); - - sep.prepare(audioSource); - } - public void openThread(View v) { try { if (current_ui_json != null) { @@ -483,16 +438,6 @@ public void run() { catch(InterruptedException ex) {} } - public void acquireWakeLocks() { - wakeLock.acquire(); - wifiLock.acquire(); - } - - public void releaseWakeLocks() { - if(wakeLock.isHeld()) wakeLock.release(); - if(wifiLock.isHeld()) wifiLock.release(); - } - private boolean isDrawerVisible(View view) { Rect scrollBounds = new Rect(); @@ -504,20 +449,29 @@ private boolean isDrawerVisible(View view) { } } + private void playPlayerService() { + Intent i = new Intent(this, RadioService.class); + i.putExtra("action", "io.r_a_d.radio.PLAY"); + startService(i); + } + + private void pausePlayerService() { + Intent i = new Intent(this, RadioService.class); + i.putExtra("action", "io.r_a_d.radio.PAUSE"); + startService(i); + } + public void togglePlayPause(View v) { if(isDrawerVisible(findViewById(android.R.id.content))) return; ImageButton img = (ImageButton)v.findViewById(R.id.play_pause); if(!playing){ img.setImageResource(R.drawable.pause_small); + playPlayerService(); playing = true; - setupMediaPlayer(); - sep.setPlayWhenReady(playing); - acquireWakeLocks(); } else { img.setImageResource(R.drawable.arrow_small); + pausePlayerService(); playing = false; - sep.stop(); - releaseWakeLocks(); } } } diff --git a/app/src/main/java/io/r_a_d/radio/RadioService.java b/app/src/main/java/io/r_a_d/radio/RadioService.java new file mode 100644 index 0000000..742dce9 --- /dev/null +++ b/app/src/main/java/io/r_a_d/radio/RadioService.java @@ -0,0 +1,140 @@ +package io.r_a_d.radio; + +import android.app.Notification; +import android.app.PendingIntent; +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.graphics.BitmapFactory; +import android.graphics.drawable.Icon; +import android.net.Uri; +import android.net.wifi.WifiManager; +import android.os.Build; +import android.os.IBinder; +import android.os.PowerManager; +import android.support.annotation.Nullable; + +import com.google.android.exoplayer2.DefaultLoadControl; +import com.google.android.exoplayer2.ExoPlayerFactory; +import com.google.android.exoplayer2.LoadControl; +import com.google.android.exoplayer2.SimpleExoPlayer; +import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; +import com.google.android.exoplayer2.extractor.ExtractorsFactory; +import com.google.android.exoplayer2.source.ExtractorMediaSource; +import com.google.android.exoplayer2.source.MediaSource; +import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; +import com.google.android.exoplayer2.trackselection.TrackSelector; +import com.google.android.exoplayer2.upstream.DataSource; +import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; +import com.google.android.exoplayer2.util.Util; + +public class RadioService extends Service { + + private static final String ACTION_PLAY = "io.r_a_d.radio.PLAY"; + private static final String ACTION_PAUSE = "io.r_a_d.radio.PAUSE"; + + + + private PowerManager powerManager; + private PowerManager.WakeLock wakeLock; + private WifiManager wifiManager; + private WifiManager.WifiLock wifiLock; + private SimpleExoPlayer sep; + private Notification notification; + + + private String radio_url = "https://stream.r-a-d.io/main.mp3"; + + public RadioService() { + } + + @Override + public void onCreate() { + super.onCreate(); + + powerManager = (PowerManager) getSystemService(POWER_SERVICE); + wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "KilimDankLock"); + wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); + wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "KilimDankWifiLock"); + createMediaPlayer(); + + Intent notificationIntent = new Intent(this, ActivityMain.class); + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, + notificationIntent, 0); + + Notification.Builder builder = new Notification.Builder(this); + + builder.setContentTitle("R/a/dio is streaming"); + builder.setContentText("Touch to return to app"); + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + builder.setSmallIcon(R.drawable.lollipop_logo); + //builder.setColor(0xFFFF0000); + } else { + builder.setSmallIcon(R.drawable.actionbar_logo); + } + builder.setSmallIcon(R.drawable.actionbar_logo); + builder.setContentIntent(pendingIntent); + notification = builder.build(); + + } + + + + public void setupMediaPlayer() { + DataSource.Factory dsf = new DefaultDataSourceFactory(this, + Util.getUserAgent(this, "R/a/dio-Android-App")); + ExtractorsFactory extractors = new DefaultExtractorsFactory(); + MediaSource audioSource = new ExtractorMediaSource(Uri.parse(radio_url), dsf, extractors, null, null); + + sep.prepare(audioSource); + } + + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + + if (intent.getStringExtra("action").equals(ACTION_PLAY)) { + setupMediaPlayer(); + sep.setPlayWhenReady(true); + acquireWakeLocks(); + startForeground(1, notification); + } else if (intent.getStringExtra("action").equals(ACTION_PAUSE)){ + sep.stop(); + releaseWakeLocks(); + stopForeground(true); + } + + return super.onStartCommand(intent, flags, startId); + } + + @Override + public void onDestroy() { + super.onDestroy(); + sep.stop(); + sep.release(); + sep = null; + releaseWakeLocks(); + } + + @Nullable + @Override + public IBinder onBind(Intent intent) { + return null; + } + + public void acquireWakeLocks() { + wakeLock.acquire(); + wifiLock.acquire(); + } + + public void releaseWakeLocks() { + if(wakeLock.isHeld()) wakeLock.release(); + if(wifiLock.isHeld()) wifiLock.release(); + } + + public void createMediaPlayer() { + TrackSelector tSelector = new DefaultTrackSelector(); + LoadControl lc = new DefaultLoadControl(); + sep = ExoPlayerFactory.newSimpleInstance(this, tSelector, lc); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/lollipop_logo.png b/app/src/main/res/drawable/lollipop_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..637cff97b7f716dc81bd3fcbbd1eb9c48f30d500 GIT binary patch literal 1687 zcmV;I259+-P)<{98FWQhbW?9;ba!ELWdLwtX>N2bZe?^J zG%heMF)*zP3cvsW1{6s|K~#8N?VD?;RYe@dwS1&TnUzr4i>N5I2bE4_kmRR|%0SYH2!$S05M&xr6cs&%AVTbk(3i4^=yeD+d)fPaT5D$Sv**rT``kHq zW=?5)!H;|P+Ouc=|GDSvGmm}73=R%9bU~U871C^|kY+=LG#e_U*-#|& z4L+w)=nrs^sOR9~oU32KEq>X4BF#_`{0V^Xm^y6*+wIFCnkMR+Yfnk7^vm}PX@-Kp zAGh)MEY(5x+EcZ>1E)E4Ob7SzL=WoQKvJ5$fMCx6n@reYS|RE<$({<e6;p#7NK9~TWr{U>ius`6GVEn z37rK#FsZfMw}Uy(IezSx1GVs9r&VtKIgw@#kQ8s+_W<6HxUEwT6#boy5Dlm{av;r| zAh~%q$0+U99mEa9Snbsv#2wfW@y7n6ecAa23b@cPTJCAjR=rfHQtB{7>-f&w(^^ zfP^jty@(xh0XWpDqs0@2IM>VGNzzOW5*ZKPWmbXWpz#1v4@clnu|T2aewoxrGc`!$ z3Y$-`*qOCAW}M@yB?p_F_@1cBq(Yi0K>~+?&^eZ?FTe|6p;H&1H#)X>U9MrTFVE*d znyEnW+%^5wq!A~4tXiC^a6M^DQTG(E8*n*yuHSYlq?rN)&83bHK`L=mvhJhGC)lzq ze@GLJ@jw3@;Jj&yDpLo_p9)q3-Xl`#J;3cDj;`Mad^hnUSn7HePb|_TXmBCmOq*}x zN5C?`=M8=M7~YKqTp3K=F{QXuayWPy@SS-KxC4~p!dvoHMroFy!40PA|Bkq&)a_xb zWh##tq*;OnxsUa>X*y2sQ?4wapKfT9f-i&z@4$)iS zOy^p64mDc29rU2Jq|C=K71FE&jdOv$+dGNt&HVZu@+2ybQ*_W;r@j%luu~z;ZXkf8 zz!npV6&JwxRK`H7)f)C_OL0w#4qEKh`H{7UDe2>R(i{l{!ADg%VO#>nsWL7olcIwr zdvz|h_Au>q%f%wi)F9{-9dwCTC+B8ro|p77VQHoYL8s^-{wQXuSFf6z{ck&ndeWJ#?(x??T!!haGUi5_IYDxq0G|TR1*^crfKvy>LtrI1 h2h0S0-as52^AC<3;P0%Gl_vlI002ovPDHLkV1fs{69xbP literal 0 HcmV?d00001 From ae59ee85745fa22b79bfa7c113205de0ff64cb9c Mon Sep 17 00:00:00 2001 From: Rest Date: Tue, 3 Jan 2017 01:08:04 -0600 Subject: [PATCH 2/8] This fixes the notification? After downloading an emulator for like the 5th time, I read source code, made theory, and then figured out I was right http://i.imgur.com/CPbNQee.gif --- app/src/main/java/io/r_a_d/radio/RadioService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/io/r_a_d/radio/RadioService.java b/app/src/main/java/io/r_a_d/radio/RadioService.java index 742dce9..a1f5174 100644 --- a/app/src/main/java/io/r_a_d/radio/RadioService.java +++ b/app/src/main/java/io/r_a_d/radio/RadioService.java @@ -72,7 +72,6 @@ public void onCreate() { } else { builder.setSmallIcon(R.drawable.actionbar_logo); } - builder.setSmallIcon(R.drawable.actionbar_logo); builder.setContentIntent(pendingIntent); notification = builder.build(); From 29320f05c672ba3430d3b2b57e12ee0da1307626 Mon Sep 17 00:00:00 2001 From: Rest Date: Tue, 3 Jan 2017 14:00:55 -0600 Subject: [PATCH 3/8] This fixes the play/pause? I'm not quite sure about where/when pages are instantiated but I know that when the UI updates it is successful. Therefore when the UI updates, it'll also do the same for the update button. http://i.imgur.com/xx3heN8.gif --- .../main/java/io/r_a_d/radio/ActivityMain.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/r_a_d/radio/ActivityMain.java b/app/src/main/java/io/r_a_d/radio/ActivityMain.java index 0657167..9a17091 100644 --- a/app/src/main/java/io/r_a_d/radio/ActivityMain.java +++ b/app/src/main/java/io/r_a_d/radio/ActivityMain.java @@ -94,7 +94,6 @@ public void run() { }); songCalcThread.setDaemon(true); songCalcThread.start(); - } @Override @@ -279,6 +278,16 @@ public void updateUI(){ } } + // Fix for syncing play/pause button by taking advantage of the fact that this code gets + // called after the JSON gets scraped everything the main activity is instantiated. + // I don't know where else it could/should go. + ImageButton img = (ImageButton)now_playing.findViewById(R.id.play_pause); + if(PlayerState.CURRENTLY_PLAYING){ + img.setImageResource(R.drawable.pause_small); + } else { + img.setImageResource(R.drawable.arrow_small); + } + } catch (JSONException e) { e.printStackTrace(); } @@ -464,14 +473,14 @@ private void pausePlayerService() { public void togglePlayPause(View v) { if(isDrawerVisible(findViewById(android.R.id.content))) return; ImageButton img = (ImageButton)v.findViewById(R.id.play_pause); - if(!playing){ + if(!PlayerState.CURRENTLY_PLAYING){ img.setImageResource(R.drawable.pause_small); playPlayerService(); - playing = true; + PlayerState.CURRENTLY_PLAYING = true; } else { img.setImageResource(R.drawable.arrow_small); pausePlayerService(); - playing = false; + PlayerState.CURRENTLY_PLAYING = false; } } } From 9c7aad86f24ad7b0c5b182f9000d813f621a72bc Mon Sep 17 00:00:00 2001 From: Rest Date: Tue, 3 Jan 2017 14:03:05 -0600 Subject: [PATCH 4/8] File was not comitted --- app/src/main/java/io/r_a_d/radio/PlayerState.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/src/main/java/io/r_a_d/radio/PlayerState.java diff --git a/app/src/main/java/io/r_a_d/radio/PlayerState.java b/app/src/main/java/io/r_a_d/radio/PlayerState.java new file mode 100644 index 0000000..4b93b7d --- /dev/null +++ b/app/src/main/java/io/r_a_d/radio/PlayerState.java @@ -0,0 +1,9 @@ +package io.r_a_d.radio; + +/** + * Created by resttime on 1/3/2017. + */ + +public final class PlayerState { + public static boolean CURRENTLY_PLAYING = false; +} From 754f54d755f71eae69d4a8617f7367466df4992e Mon Sep 17 00:00:00 2001 From: Rest Date: Tue, 3 Jan 2017 18:13:59 -0600 Subject: [PATCH 5/8] Try fixing the problem on "app closed" when removing task --- app/src/main/java/io/r_a_d/radio/RadioService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/io/r_a_d/radio/RadioService.java b/app/src/main/java/io/r_a_d/radio/RadioService.java index a1f5174..26f745a 100644 --- a/app/src/main/java/io/r_a_d/radio/RadioService.java +++ b/app/src/main/java/io/r_a_d/radio/RadioService.java @@ -115,6 +115,14 @@ public void onDestroy() { releaseWakeLocks(); } + @Override + public void onTaskRemoved(Intent rootIntent) { + if(!PlayerState.CURRENTLY_PLAYING) { + stopSelf(); + } + super.onTaskRemoved(rootIntent); + } + @Nullable @Override public IBinder onBind(Intent intent) { From cb62c9812d9a42e318e494851942aa857fd713ff Mon Sep 17 00:00:00 2001 From: Robert Rowe Date: Tue, 3 Jan 2017 16:25:33 -0800 Subject: [PATCH 6/8] Notification logo changes --- .../main/java/io/r_a_d/radio/RadioService.java | 4 ++-- app/src/main/res/drawable/normal_logo.png | Bin 0 -> 4317 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/drawable/normal_logo.png diff --git a/app/src/main/java/io/r_a_d/radio/RadioService.java b/app/src/main/java/io/r_a_d/radio/RadioService.java index 26f745a..1eaad4e 100644 --- a/app/src/main/java/io/r_a_d/radio/RadioService.java +++ b/app/src/main/java/io/r_a_d/radio/RadioService.java @@ -68,9 +68,9 @@ public void onCreate() { builder.setContentText("Touch to return to app"); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { builder.setSmallIcon(R.drawable.lollipop_logo); - //builder.setColor(0xFFFF0000); + builder.setColor(0xFFDF4C3A); } else { - builder.setSmallIcon(R.drawable.actionbar_logo); + builder.setSmallIcon(R.drawable.normal_logo); } builder.setContentIntent(pendingIntent); notification = builder.build(); diff --git a/app/src/main/res/drawable/normal_logo.png b/app/src/main/res/drawable/normal_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9a286c8ab2cea996f941f806858aa193bf273afa GIT binary patch literal 4317 zcmV<35F+o1P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^5z3JSmg01!<{L_t(|Ufo;?RFqeiu9=>m?lV10pP4@G z^u&aqfUHF=>{1jv0veLEWY_+u`F>&d{B`5;o0#s`vM(BwxZJt-r@*S>u@qDh?RU<1fd7B>zk9#`zPr5l3f@e&btWc1S#4@$vDM0W z(GKf5>-XE5?Eg$?cIvR5dCcGJ%@Ya7>?|%G5t|)9C^Xr(&vx#boz`;#Hd@X$*)HY% zlj<>lKW&wm_v6i$MuHvI#+wcbO_RTNw78exX8S15+YUJZg< zuWW%M6#Ljis=M&fIT!2xlMd#WLq%q5c3K%(Z0GU*Q8mo7)kyFS^Ne2HZuR2k&qZeS z2@?K8g|7ogMB_piXqqDEvqW4ul9uHud=TzrRgTYJ{jsg-b2#ij42}L2HzH<}g^_T# z&D_i9oUQNEn%IX7TX=GtnrGk4W9W26k^Nr2mX(eid>Hi4!@#iMQxY|6TH#{9n z(G@gSO@I?*dWgOYbFhpgqEur2@NJdZuYR%9YR-X3XRC*m{xeIAHfZcxoW>bQ)G2$5 z9otPz{#_;J%r`RS56xZ-I$~$uNmJ>EBt{z~O9fhSoGZWSbD^mliaWE@ZmE&cPd~DH z@j$FA{~a$p7VeiN8JNV6pX>So~v^_=asXrS|aW=45+`pDL>v3ypy;lukU3 zcCk(}_>@~`^8DOTp=k|;Y?d%jE9gbmU`~}N;VX{}r3CtK8%&J^N5%8*P=sO$@hpJc zL9$fPaM;dtj!G^4v~?ygSRND4>!PfeHSn_pA}K{GXgnsid_kq&^x6vJU(PxtGHap` z&KmGp1f>GWZno8*+8X^_rRLOH$gEjE+sij8qMC^{(6bCmEE6QQNlSRVAF0&UtHNVZ&($9de|P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Zna;B4)fgo|m{K&P`ydQcJ%LElGqz+|d?l7~Oa7K+=Id z5P@}6DZXhkb=r#7M?O@N7{_JI6qe=hy)$OvORJ5na8Fr%j;E+W@0O$8?%%&}jDnO5 z3)F|n8f`6K*|QVQ`nUjP;p)o}3ar9=F)R=FpDN{k+Zi59#@ z#;5*7*fmd4_BpBLf2-6mY{TgGFD027XTsO6d=%zk&u!w7Z_u9mBpiK_rB4-grixxH zN>6z@j1W&#h1>sUSW$Cn3GIk-{ir`y1mCB)3l2>?TIt&8KfN5cvk1xd6nD@rDl2jf z5#%v#f+$+0Z`(97b?CXWm)xMc<;JMKowshn6?EoQKIEY@PH?mF|3UvF%$JVVv*O+O zr({0%54BeTID&$vZ$X5v)?1Li*muN==%pwbTh(3dw;!K&7k_irUGSOC<%1zxgo6d0 z)-N0`a)(J$;G3T6cRI9De=P$FRjY`E!i5s(QnMnow8#BDJy-Yoc}}h>pXo-^?yRHb zOKI-HbeXT+1A5Eyg|5)sI{B0If>KSD*WA^Pz5sSx%(ey#_Rri?xRL4>1~#f<&So0)9Ay}dt2B?W_ngTbiu z4n!Ct38zOsUN0cv-+6dH0e_yvzyF9o7vta7XeIxuddv(p9`FAFyG4l_xOg2;00000 LNkvXXu0mjfaELux literal 0 HcmV?d00001 From a47cf747b9b08ec9031677e53927eda555fd6e63 Mon Sep 17 00:00:00 2001 From: Robert Rowe Date: Tue, 3 Jan 2017 16:43:19 -0800 Subject: [PATCH 7/8] ???? ??????? --- app/src/main/res/drawable/splashscreen.xml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 app/src/main/res/drawable/splashscreen.xml diff --git a/app/src/main/res/drawable/splashscreen.xml b/app/src/main/res/drawable/splashscreen.xml deleted file mode 100644 index 78b73a7..0000000 --- a/app/src/main/res/drawable/splashscreen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 21ed924837a96b7c434dd0a902a764dde52d1cb8 Mon Sep 17 00:00:00 2001 From: Robert Rowe Date: Tue, 3 Jan 2017 16:52:56 -0800 Subject: [PATCH 8/8] Fix merge errors, clean imports --- .../java/io/r_a_d/radio/ActivityMain.java | 25 +------------------ .../java/io/r_a_d/radio/RadioService.java | 2 -- .../main/java/io/r_a_d/radio/Requestor.java | 5 ---- app/src/main/res/layout/news.xml | 2 +- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/io/r_a_d/radio/ActivityMain.java b/app/src/main/java/io/r_a_d/radio/ActivityMain.java index 2191583..62463af 100644 --- a/app/src/main/java/io/r_a_d/radio/ActivityMain.java +++ b/app/src/main/java/io/r_a_d/radio/ActivityMain.java @@ -29,28 +29,9 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import org.w3c.dom.Text; - -<<<<<<< HEAD -======= -import com.google.android.exoplayer2.DefaultLoadControl; -import com.google.android.exoplayer2.ExoPlayerFactory; -import com.google.android.exoplayer2.LoadControl; -import com.google.android.exoplayer2.SimpleExoPlayer; -import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; -import com.google.android.exoplayer2.extractor.ExtractorsFactory; -import com.google.android.exoplayer2.source.ExtractorMediaSource; -import com.google.android.exoplayer2.source.MediaSource; -import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; -import com.google.android.exoplayer2.trackselection.TrackSelector; -import com.google.android.exoplayer2.upstream.DataSource; -import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; -import com.google.android.exoplayer2.util.Util; -import java.util.ArrayList; ->>>>>>> refs/remotes/origin/master import java.util.HashMap; -import java.util.List; +import java.util.ArrayList; public class ActivityMain extends AppCompatActivity implements ViewPager.OnPageChangeListener{ @@ -117,11 +98,7 @@ public void run() { }); songCalcThread.setDaemon(true); songCalcThread.start(); -<<<<<<< HEAD -======= - mRequestor = new Requestor(this); ->>>>>>> refs/remotes/origin/master } @Override diff --git a/app/src/main/java/io/r_a_d/radio/RadioService.java b/app/src/main/java/io/r_a_d/radio/RadioService.java index 1eaad4e..65ade70 100644 --- a/app/src/main/java/io/r_a_d/radio/RadioService.java +++ b/app/src/main/java/io/r_a_d/radio/RadioService.java @@ -5,8 +5,6 @@ import android.app.Service; import android.content.Context; import android.content.Intent; -import android.graphics.BitmapFactory; -import android.graphics.drawable.Icon; import android.net.Uri; import android.net.wifi.WifiManager; import android.os.Build; diff --git a/app/src/main/java/io/r_a_d/radio/Requestor.java b/app/src/main/java/io/r_a_d/radio/Requestor.java index fbd55c8..ec01e02 100644 --- a/app/src/main/java/io/r_a_d/radio/Requestor.java +++ b/app/src/main/java/io/r_a_d/radio/Requestor.java @@ -1,7 +1,6 @@ package io.r_a_d.radio; import android.os.AsyncTask; -import android.text.Html; import android.util.Xml; import android.widget.Toast; @@ -12,16 +11,12 @@ import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.CookieHandler; import java.net.CookieManager; -import java.net.CookieStore; -import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; -import java.util.concurrent.ExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/app/src/main/res/layout/news.xml b/app/src/main/res/layout/news.xml index 7017ed0..c546832 100644 --- a/app/src/main/res/layout/news.xml +++ b/app/src/main/res/layout/news.xml @@ -42,7 +42,7 @@