forked from CatVodTVOfficial/TVBoxOSC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SDL
committed
Jun 27, 2022
1 parent
cc27b75
commit e3b0bb8
Showing
12 changed files
with
148 additions
and
217 deletions.
There are no files selected for viewing
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
28 changes: 0 additions & 28 deletions
28
app/src/main/java/com/github/tvbox/osc/receiver/ProjectionReceiver.java
This file was deleted.
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
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 |
---|---|---|
|
@@ -14,4 +14,6 @@ public interface DataReceiver { | |
|
||
|
||
void onApiReceived(String url); | ||
|
||
void onPushReceived(String url); | ||
} |
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
180 changes: 0 additions & 180 deletions
180
app/src/main/java/com/github/tvbox/osc/ui/activity/ProjectionPlayActivity.java
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
app/src/main/java/com/github/tvbox/osc/ui/activity/PushActivity.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,68 @@ | ||
package com.github.tvbox.osc.ui.activity; | ||
|
||
import android.content.ClipData; | ||
import android.content.ClipboardManager; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.view.View; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import com.github.tvbox.osc.R; | ||
import com.github.tvbox.osc.base.BaseActivity; | ||
import com.github.tvbox.osc.server.ControlManager; | ||
import com.github.tvbox.osc.ui.tv.QRCodeGen; | ||
|
||
import me.jessyan.autosize.utils.AutoSizeUtils; | ||
|
||
public class PushActivity extends BaseActivity { | ||
private ImageView ivQRCode; | ||
private TextView tvAddress; | ||
|
||
@Override | ||
protected int getLayoutResID() { | ||
return R.layout.activity_push; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
initView(); | ||
initData(); | ||
} | ||
|
||
private void initView() { | ||
ivQRCode = findViewById(R.id.ivQRCode); | ||
tvAddress = findViewById(R.id.tvAddress); | ||
refreshQRCode(); | ||
findViewById(R.id.pushLocal).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
try { | ||
ClipboardManager manager = (ClipboardManager) PushActivity.this.getSystemService(Context.CLIPBOARD_SERVICE); | ||
if (manager != null) { | ||
if (manager.hasPrimaryClip() && manager.getPrimaryClip() != null && manager.getPrimaryClip().getItemCount() > 0) { | ||
ClipData.Item addedText = manager.getPrimaryClip().getItemAt(0); | ||
Intent newIntent = new Intent(mContext, DetailActivity.class); | ||
newIntent.putExtra("id", addedText.getText().toString().trim()); | ||
newIntent.putExtra("sourceKey", "push_agent"); | ||
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); | ||
PushActivity.this.startActivity(newIntent); | ||
} | ||
} | ||
} catch (Throwable th) { | ||
|
||
} | ||
} | ||
}); | ||
} | ||
|
||
private void refreshQRCode() { | ||
String address = ControlManager.get().getAddress(false); | ||
tvAddress.setText(String.format("手机/电脑扫描上方二维码或者直接浏览器访问地址\n%s", address)); | ||
ivQRCode.setImageBitmap(QRCodeGen.generateBitmap(address, AutoSizeUtils.mm2px(this, 300), AutoSizeUtils.mm2px(this, 300), 4)); | ||
} | ||
|
||
private void initData() { | ||
|
||
} | ||
} |
Oops, something went wrong.