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

View File

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

View File

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

View File

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