mirror of https://github.com/FongMi/TV.git
parent
823e600912
commit
4e0b71f0f4
@ -0,0 +1,33 @@ |
||||
package com.fongmi.android.tv.ui.activity; |
||||
|
||||
import android.app.Activity; |
||||
import android.content.Intent; |
||||
|
||||
import androidx.viewbinding.ViewBinding; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.databinding.ActivityPushBinding; |
||||
import com.fongmi.android.tv.server.Server; |
||||
import com.fongmi.android.tv.utils.QRCode; |
||||
import com.fongmi.android.tv.utils.ResUtil; |
||||
|
||||
public class PushActivity extends BaseActivity { |
||||
|
||||
private ActivityPushBinding mBinding; |
||||
|
||||
public static void start(Activity activity) { |
||||
activity.startActivity(new Intent(activity, PushActivity.class)); |
||||
} |
||||
|
||||
@Override |
||||
protected ViewBinding getBinding() { |
||||
return mBinding = ActivityPushBinding.inflate(getLayoutInflater()); |
||||
} |
||||
|
||||
@Override |
||||
protected void initView() { |
||||
String address = Server.get().getAddress(false); |
||||
mBinding.code.setImageBitmap(QRCode.getBitmap(address, 250, 1)); |
||||
mBinding.info.setText(ResUtil.getString(R.string.push_info, address)); |
||||
} |
||||
} |
||||
@ -0,0 +1,30 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:background="@color/black_20" |
||||
android:gravity="center" |
||||
android:keepScreenOn="true" |
||||
android:orientation="vertical"> |
||||
|
||||
<ImageView |
||||
android:id="@+id/code" |
||||
android:layout_width="250dp" |
||||
android:layout_height="250dp" |
||||
android:scaleType="fitXY" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/info" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="24dp" |
||||
android:gravity="center" |
||||
android:lineSpacingExtra="4dp" |
||||
android:shadowColor="@color/black" |
||||
android:shadowDx="2" |
||||
android:shadowDy="2" |
||||
android:shadowRadius="1" |
||||
android:textColor="@color/white" |
||||
android:textSize="18sp" /> |
||||
|
||||
</LinearLayout> |
||||
Loading…
Reference in new issue