语音转文字
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.lzf.easyfloat.interfaces.OnPermissionResult;
|
||||
import com.lzf.easyfloat.permission.PermissionUtils;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -41,14 +45,46 @@ public class HintDialog extends AbsDialogFragment {
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
TextView hint = (TextView) findViewById(R.id.hint);
|
||||
TextView toSetUp = (TextView) findViewById(R.id.to_set_up);
|
||||
TextView knowThe = (TextView) findViewById(R.id.know_the);
|
||||
IMLoginManager.get(mContext).initISHint();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteUtil.forwardSettingActivity();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.know_the), () -> dismiss());
|
||||
Bundle args = getArguments();
|
||||
if (args != null && !TextUtils.isEmpty(args.getString("close")) && TextUtils.equals(args.getString("close"), "1")) {
|
||||
hint.setText(getString(R.string.do_you_like));
|
||||
toSetUp.setText(getString(R.string.to_set_up));
|
||||
knowThe.setText(getString(R.string.know_the));
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteUtil.forwardSettingActivity();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.know_the), () -> dismiss());
|
||||
} else {
|
||||
hint.setText(getString(R.string.want_pre));
|
||||
toSetUp.setText(getString(R.string.know_the));
|
||||
knowThe.setText(getString(R.string.to_set_up));
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
PermissionUtils.requestPermission(getActivity(), new OnPermissionResult() {
|
||||
@Override
|
||||
public void permissionResult(boolean b) {
|
||||
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private final static String IS_SLIDE = "isSlide";
|
||||
private final static String IS_FLOAT = "is_float";
|
||||
private final static String IS_HINT = "is_hint";
|
||||
private final static String IS_HINT2 = "is_hint2";
|
||||
|
||||
|
||||
public boolean isHint() {
|
||||
@@ -44,6 +45,14 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
int number = getInt(IS_HINT, 0) + 1;
|
||||
put(IS_HINT, number);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHint2() {
|
||||
return getBoolean(IS_HINT2, true);
|
||||
}
|
||||
|
||||
public void initISHint2() {
|
||||
put(IS_HINT, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -70,8 +71,11 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay();
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
if (IMLoginManager.get(mContext).isHint()) {
|
||||
if (IMLoginManager.get(mContext).isHint2()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("close", "1");
|
||||
fragment.setArguments(args);
|
||||
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HintDialog");
|
||||
}
|
||||
}
|
||||
@@ -163,8 +167,11 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay();
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
if (IMLoginManager.get(mContext).isHint()) {
|
||||
if (IMLoginManager.get(mContext).isHint2()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("close", "1");
|
||||
fragment.setArguments(args);
|
||||
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HintDialog");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16.33dp"
|
||||
|
||||
@@ -931,4 +931,5 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="alerts">Message Settings</string>
|
||||
<string name="studio_gift_effects">Blocking gift effects</string>
|
||||
<string name="studio_ride_effects">Blocking seat effects</string>
|
||||
<string name="want_pre">If you want to Minimize Play,\nYou can go to set the license.</string>
|
||||
</resources>
|
||||
|
||||
@@ -945,4 +945,5 @@
|
||||
<string name="studio_ride_effects">屏蔽直播間座駕特效</string>
|
||||
<string name="in_batch">換一批</string>
|
||||
<string name="chat_chat">聊聊天</string>
|
||||
<string name="want_pre">想在其他APP上方也顯示小窗,\n可前往設置進行授權。</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user