-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from ksvc/update
Update
- Loading branch information
Showing
328 changed files
with
10,600 additions
and
572 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
KsyunPlayerDemo/app/src/main/java/com/ksyun/player/demo/ChooseActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.ksyun.player.demo; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.provider.Settings; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.view.WindowManager; | ||
import android.widget.ImageView; | ||
import android.widget.LinearLayout; | ||
import android.widget.Toast; | ||
|
||
import com.github.mzule.activityrouter.router.Routers; | ||
import com.ksyun.player.now.utils.Setting; | ||
|
||
|
||
public class ChooseActivity extends AppCompatActivity implements View.OnClickListener { | ||
|
||
private static final int OVERLAY_PERMISSION_RESULT_CODE = 170; | ||
|
||
private LinearLayout toOldVersion; | ||
|
||
private ImageView vodImagView,liveImageView; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_choose); | ||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){ | ||
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | ||
} | ||
initView(); | ||
checkPermission(); | ||
} | ||
private void initView(){ | ||
toOldVersion=(LinearLayout)findViewById(R.id.to_old_version); | ||
vodImagView=(ImageView)findViewById(R.id.vod); | ||
liveImageView=(ImageView)findViewById(R.id.live); | ||
toOldVersion.setOnClickListener(this); | ||
liveImageView.setOnClickListener(this); | ||
vodImagView.setOnClickListener(this); | ||
} | ||
|
||
private void checkPermission() { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) { | ||
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, | ||
Uri.parse("package:" + getPackageName())); | ||
startActivityForResult(intent, OVERLAY_PERMISSION_RESULT_CODE); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
if (requestCode == OVERLAY_PERMISSION_RESULT_CODE) { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) | ||
if (!Settings.canDrawOverlays(this)) | ||
Toast.makeText(this, "Permission SYSTEM_ALERT_WINDOW not granted", Toast.LENGTH_SHORT).show(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onClick(View view) { | ||
switch (view.getId()){ | ||
case R.id.to_old_version: | ||
Routers.open(ChooseActivity.this, "oldVersionMain://oldMain"); | ||
break; | ||
case R.id.vod: | ||
Routers.open(ChooseActivity.this, "vod://vodMain"); | ||
break; | ||
case R.id.live: | ||
Routers.open(ChooseActivity.this, "live://liveMain"); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} |
Empty file modified
0
KsyunPlayerDemo/app/src/main/java/com/ksyun/player/demo/PlayerApplication.java
100644 → 100755
Empty file.
82 changes: 82 additions & 0 deletions
82
KsyunPlayerDemo/app/src/main/java/com/ksyun/player/demo/SplashActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.ksyun.player.demo; | ||
|
||
import android.content.Intent; | ||
import android.content.pm.PackageInfo; | ||
import android.content.pm.PackageManager; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.view.WindowManager; | ||
import android.widget.Button; | ||
import android.widget.TextView; | ||
|
||
import com.github.mzule.activityrouter.annotation.Module; | ||
import com.github.mzule.activityrouter.annotation.Modules; | ||
|
||
import java.util.Timer; | ||
import java.util.TimerTask; | ||
|
||
|
||
|
||
@Modules({"app", "oldplayerdemo", "newplayerdemo"}) | ||
@Module("app") | ||
public class SplashActivity extends AppCompatActivity { | ||
|
||
private Button button; | ||
private TextView textView; | ||
private Timer timer; | ||
private TimerTask timerTask; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_splash); | ||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){ | ||
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | ||
} | ||
button=(Button)findViewById(R.id.button); | ||
button.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
jumpToNext(); | ||
|
||
} | ||
}); | ||
textView=(TextView)findViewById(R.id.sdk_version); | ||
String version=getVersion(); | ||
if(!version.equals("error")){ | ||
textView.setText("SDK V"+version+"版本"); | ||
} | ||
setTimer(); | ||
} | ||
private void setTimer(){ | ||
timerTask=new MyTimerTask(); | ||
timer=new Timer(); | ||
timer.schedule(timerTask,3000); | ||
} | ||
private void jumpToNext(){ | ||
Intent intent=new Intent(SplashActivity.this, ChooseActivity.class); | ||
startActivity(intent); | ||
timer.cancel(); | ||
finish(); | ||
} | ||
private String getVersion(){ | ||
try { | ||
PackageManager manager=getPackageManager(); | ||
PackageInfo packageInfo=manager.getPackageInfo(getPackageName(),0); | ||
String version=packageInfo.versionName; | ||
return version; | ||
} catch (PackageManager.NameNotFoundException e) { | ||
e.printStackTrace(); | ||
return "error"; | ||
} | ||
|
||
} | ||
private class MyTimerTask extends TimerTask | ||
{ | ||
@Override | ||
public void run() { | ||
jumpToNext(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@color/white" android:state_pressed="true" /> | ||
<item android:drawable="@color/colorAccent" android:state_pressed="false" /> | ||
<item android:drawable="@color/white" /> | ||
</selector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.