Compare commits
4 commits
1dde72d2c6
...
49e79b723f
Author | SHA1 | Date | |
---|---|---|---|
49e79b723f | |||
b09c81568b | |||
d877db3b98 | |||
ca0e77a645 |
4 changed files with 32 additions and 8 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bin/
|
|
@ -2,12 +2,12 @@
|
||||||
<manifest
|
<manifest
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.arkiwi.app"
|
package="org.arkiwi.app"
|
||||||
android:versionCode="3"
|
android:versionCode="4"
|
||||||
android:versionName="CRUSCA" >
|
android:versionName="MAIS" >
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
android:targetSdkVersion="10"
|
android:targetSdkVersion="10"
|
||||||
android:maxSdkVersion="18"
|
android:maxSdkVersion="25"
|
||||||
/>
|
/>
|
||||||
<!-- check per la rete -->
|
<!-- check per la rete -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#4a4a4a">
|
android:background="#4a4a4a"
|
||||||
|
android:keepScreenOn="true">
|
||||||
|
|
||||||
<!-- Player Header -->
|
<!-- Player Header -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -183,4 +184,4 @@
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:background="@null"/>
|
android:background="@null"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -18,6 +18,7 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -40,6 +41,8 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
// Media Player
|
// Media Player
|
||||||
private MediaPlayer mp;
|
private MediaPlayer mp;
|
||||||
// Handler to update UI timer, progress bar etc,.
|
// Handler to update UI timer, progress bar etc,.
|
||||||
|
private WindowManager.LayoutParams layout;
|
||||||
|
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
private SongsManager songManager;
|
private SongsManager songManager;
|
||||||
private Utilities utils;
|
private Utilities utils;
|
||||||
|
@ -54,6 +57,9 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.pl_player);
|
setContentView(R.layout.pl_player);
|
||||||
|
|
||||||
|
layout = getWindow().getAttributes();
|
||||||
|
|
||||||
Log.d(LOG_TAG, "onCreate()");
|
Log.d(LOG_TAG, "onCreate()");
|
||||||
// All player buttons
|
// All player buttons
|
||||||
btnPlay = (ImageButton) findViewById(R.id.btnPlay);
|
btnPlay = (ImageButton) findViewById(R.id.btnPlay);
|
||||||
|
@ -265,6 +271,9 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
|
layout.screenBrightness = -1;
|
||||||
|
getWindow().setAttributes(layout);
|
||||||
|
|
||||||
Intent i = new Intent(getApplicationContext(), PlayListActivity.class);
|
Intent i = new Intent(getApplicationContext(), PlayListActivity.class);
|
||||||
startActivityForResult(i, 100);
|
startActivityForResult(i, 100);
|
||||||
}
|
}
|
||||||
|
@ -275,6 +284,7 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
resumeSong();
|
resumeSong();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,6 +302,9 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
} else {
|
} else {
|
||||||
playng=true;
|
playng=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layout.screenBrightness = 0.1f;
|
||||||
|
getWindow().setAttributes(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
return playng;
|
return playng;
|
||||||
|
@ -306,10 +319,10 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
int resultCode, Intent data) {
|
int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if(resultCode == 100){
|
if(resultCode == 100){
|
||||||
currentSongIndex = data.getExtras().getInt("songIndex");
|
currentSongIndex = data.getExtras().getInt("songIndex");
|
||||||
Log.d(LOG_TAG, "onActivityResult(), dalla playlist "+currentSongIndex);
|
Log.d(LOG_TAG, "onActivityResult(), dalla playlist "+currentSongIndex);
|
||||||
// play selected song
|
// play selected song
|
||||||
playSong(currentSongIndex);
|
playSong(currentSongIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -322,6 +335,10 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
// Play song
|
// Play song
|
||||||
try {
|
try {
|
||||||
Log.d(LOG_TAG, "playSong() "+songIndex);
|
Log.d(LOG_TAG, "playSong() "+songIndex);
|
||||||
|
|
||||||
|
layout.screenBrightness = 0.1f;
|
||||||
|
getWindow().setAttributes(layout);
|
||||||
|
|
||||||
mp.reset();
|
mp.reset();
|
||||||
mp.setDataSource(songsList.get(songIndex).get("songPath"));
|
mp.setDataSource(songsList.get(songIndex).get("songPath"));
|
||||||
mp.prepare();
|
mp.prepare();
|
||||||
|
@ -448,6 +465,9 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
if(mp != null) {
|
if(mp != null) {
|
||||||
if(mp.isPlaying()){
|
if(mp.isPlaying()){
|
||||||
mp.pause();
|
mp.pause();
|
||||||
|
|
||||||
|
layout.screenBrightness = -1;
|
||||||
|
getWindow().setAttributes(layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,6 +476,8 @@ public class MusicPlayerActivity extends Activity implements OnCompletionListene
|
||||||
public void onDestroy(){
|
public void onDestroy(){
|
||||||
Log.d(LOG_TAG, "onDestroy()");
|
Log.d(LOG_TAG, "onDestroy()");
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
layout.screenBrightness = -1;
|
||||||
|
getWindow().setAttributes(layout);
|
||||||
if(mp != null) {
|
if(mp != null) {
|
||||||
mHandler.removeCallbacks(mUpdateTimeTask);
|
mHandler.removeCallbacks(mUpdateTimeTask);
|
||||||
mp.release();
|
mp.release();
|
||||||
|
|
Loading…
Reference in a new issue