正在查看: St.John's v1.0.9 应用的 LearningTopicWiseContentActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: St.John's v1.0.9 应用的 LearningTopicWiseContentActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mcb.stjohnsemschool.activity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.mcb.stjohnsemschool.model.LearningTopicContentModelClass;
import com.mcb.stjohnsemschool.utils.MyGridView;
import com.mcb.stjohnsemschool.utils.TransparentProgressDialog;
import java.util.ArrayList;
public class LearningTopicWiseContentActivity extends BaseActivity {
private static final String TAG = "com.mcb.stjohnsemschool.activity.LearningTopicWiseContentActivity";
Activity activity;
Context context;
LinearLayout mExploreLL;
LinearLayout mProfileLL;
private TransparentProgressDialog mProgressbar;
TextView mSubject;
ImageView mSubjectImage;
MyGridView mTopicContent;
String subject;
ArrayList<LearningTopicContentModelClass> topicContents = new ArrayList<>();
int topicId;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_learning_topic_wise_content);
setSupportActionBar(findViewById(R.id.toolbar));
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
this.activity = this;
this.context = getApplicationContext();
this.mProgressbar = new TransparentProgressDialog(this.activity, R.drawable.spinner_loading_imag);
if (Build.VERSION.SDK_INT >= 23) {
getMultiplePermissions();
}
this.topicId = getIntent().getExtras().getInt("TopicId", this.topicId);
String string = getIntent().getExtras().getString("TopicName", getResources().getString(2131886124));
this.subject = getIntent().getExtras().getString("SubjectName", "");
CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsingToolbar);
collapsingToolbarLayout.setTitle(string.trim());
collapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.ExpandedAppBar);
collapsingToolbarLayout.setCollapsedTitleTextAppearance(R.style.CollapsedAppBar);
initializations();
}
private void initializations() {
this.mSubject = (TextView) findViewById(R.id.txv_subject);
this.mSubjectImage = (ImageView) findViewById(R.id.img_subject);
this.mTopicContent = findViewById(R.id.grid_topic_content);
this.mExploreLL = (LinearLayout) findViewById(R.id.ll_explore);
this.mProfileLL = (LinearLayout) findViewById(R.id.ll_profile);
this.mSubject.setText(this.subject);
if (this.subject.toLowerCase().contains("english")) {
this.mSubjectImage.setImageResource(R.drawable.english);
} else if (this.subject.toLowerCase().contains("social")) {
this.mSubjectImage.setImageResource(R.drawable.social);
} else if (this.subject.toLowerCase().contains("language")) {
this.mSubjectImage.setImageResource(R.drawable.language);
} else if (this.subject.toLowerCase().contains("math")) {
this.mSubjectImage.setImageResource(R.drawable.maths);
} else if (this.subject.toLowerCase().contains("science")) {
this.mSubjectImage.setImageResource(R.drawable.science);
} else if (this.subject.toLowerCase().contains("computer")) {
this.mSubjectImage.setImageResource(R.drawable.computer);
} else {
this.mSubjectImage.setImageResource(R.drawable.random);
}
this.mExploreLL.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LearningTopicWiseContentActivity.this.finish();
}
});
this.mProfileLL.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LearningTopicWiseContentActivity.this.startActivity(new Intent((Context) LearningTopicWiseContentActivity.this, (Class<?>) ProfileTabsActivity.class));
}
});
}
protected void onResume() {
super.onResume();
String string = getSharedPreferences("", 0).getString("usernamekey", "");
Bundle bundle = new Bundle();
bundle.putString("user_name", string);
FirebaseAnalytics.getInstance(this).logEvent("PAGE_LEARNING_TOPIC_CONTENT", bundle);
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == 16908332) {
super.onBackPressed();
return true;
}
return super.onOptionsItemSelected(menuItem);
}
protected void onStop() {
TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
if (transparentProgressDialog != null && transparentProgressDialog.isShowing()) {
this.mProgressbar.dismiss();
}
super.onStop();
}
}