新增h5功能全服喇叭修改

This commit is contained in:
18401019693 2022-09-21 14:55:24 +08:00
parent 83aed0bedb
commit a5826b2dc3
4 changed files with 41 additions and 17 deletions

View File

@ -908,5 +908,6 @@
<string name="emperor_hint">昭告天下! %s 向所有人推薦了主播 %s , 灼灼風華一瞥驚鴻!</string>
<string name="try_again_later">數據加載失敗,請稍後再試</string>
<string name="open_noble2">開通了</string>
<string name="enough_speakers">喇叭數量不足</string>
</resources>

View File

@ -188,21 +188,27 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
}
switch (messageType) {
case WORLDHORN:
trumpetMsg = content;
LiveNetManager.get(getContext())
.nobleUseTrumpet(trumpetMsg, mLiveUid, new HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
dismiss();
ToastUtil.show(getResources().getString(R.string.use_successfully));
}
if (trumpetNum > 0) {
trumpetMsg = content;
LiveNetManager.get(getContext())
.nobleUseTrumpet(trumpetMsg, mLiveUid, new HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
dismiss();
ToastUtil.show(getResources().getString(R.string.use_successfully));
}
@Override
public void onError(String error) {
dismiss();
ToastUtil.show(error);
}
});
} else {
ToastUtil.show(R.string.enough_speakers);
dismiss();
}
@Override
public void onError(String error) {
dismiss();
ToastUtil.show(error);
}
});
break;
case POPUPSCREEN:
((LiveActivity) mContext).sendDanmuMessage(content);
@ -235,11 +241,14 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
public void onCheckedChanged(RadioGroup group, int checkedId) {
changeCheckState(checkedId);
if (checkedId == R.id.btn_2) {
if (nobleId < 5 || trumpetNum < 1) {
if (nobleId < 5) {
imm.hideSoftInputFromWindow(mInput.getWindowToken(), 0);
HighNobilityDialog fragment = new HighNobilityDialog();
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HighNobilityDialog");
dismiss();
}

View File

@ -68,11 +68,17 @@ public class ZhuangBanActivity extends AbsActivity {
@Override
protected void main() {
String url = getIntent().getStringExtra(Constants.URL);
String titleString = getIntent().getStringExtra("title");
if (!"".equals(Constants.myPackageUrl)) {
url = Constants.myPackageUrl;
}
v_spacing = (View) findViewById(R.id.v_spacing);
lt_title = (LinearLayout) findViewById(R.id.lt_title);
if (getIntent().hasExtra("title") && TextUtils.isEmpty(titleString)) {
lt_title.setVisibility(View.GONE);
} else {
lt_title.setVisibility(View.VISIBLE);
}
// if (Constants.isTitle) {
// lt_title.setVisibility(View.VISIBLE);
// v_spacing.setVisibility(View.GONE);
@ -107,7 +113,12 @@ public class ZhuangBanActivity extends AbsActivity {
@Override
public void onPageFinished(WebView view, String url) {
setTitle(view.getTitle());
if (TextUtils.isEmpty(titleString)){
setTitle(view.getTitle());
}else {
setTitle(titleString);
}
}
});
mWebView.setWebChromeClient(new WebChromeClient() {
@ -377,6 +388,9 @@ public class ZhuangBanActivity extends AbsActivity {
Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag1212", url);
intent.putExtra(Constants.URL, url);
if (url.contains("Noble/index.html")){
intent.putExtra("title", "");
}
context.startActivity(intent);
}

View File

@ -14,7 +14,7 @@
android:id="@+id/lt_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
android:visibility="visible">
<include layout="@layout/view_title" />
</LinearLayout>