作者 liming

修改UI

正在显示 38 个修改的文件 包含 918 行增加60 行删除
... ... @@ -114,4 +114,16 @@ dependencies {
//顶部导航栏
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
//ijkplayer
implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
}
... ...
... ... @@ -64,6 +64,16 @@
-dontwarn android.support.test.**
-dontwarn org.junit.**
#ijkplayer
-keep class tv.danmaku.ijk.media.player.** {*;}
-keep class tv.danmaku.ijk.media.player.IjkMediaPlayer{*;}
-keep class tv.danmaku.ijk.media.player.ffmpeg.FFmpegApi{*;}
# In order to prevent proguard asmack source code
-keep class com.kenai.jbosh.** {*; }
-keep class com.novell.sasl.client.** {*; }
-keep class de.measite.smack.** {*; }
-keep class org.** {*; }
#okhttp
-dontwarn okhttp3.**
... ...
不能预览此文件类型
... ... @@ -36,6 +36,12 @@
android:name=".activity.study.CourseDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".activity.study.CourseDetailActivity_Video"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".activity.study.VipActivity"
android:screenOrientation="portrait" />
... ...
... ... @@ -51,7 +51,6 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn
private int playing;
private String accountOid;
@Override
public void initView() {
EventBus.getDefault().register(this);
... ... @@ -59,7 +58,7 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn
lessonOid = getIntent().getExtras().getString("lessonOid");
introduceFragment = new IntroduceFragment();
listFragment = new ListFragment();
listFragment = new ListFragment(lessonOid);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.viewPager, introduceFragment, lessonOid);
... ... @@ -70,7 +69,6 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn
linList.setOnClickListener(this);
}
public void onResumeJC(final Event event) {
new Thread(new Runnable() {
... ... @@ -115,7 +113,6 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void handleEvent(Event event) {
// 接收来自ListRecSecondChildAdapter的URL视频路径
if (event.getCode() == 1) {
Bitmap bitmap = getNetVideoBitmap(event.getPlayUrl());
... ... @@ -193,7 +190,7 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn
public void onClick(View v) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
introduceFragment = new IntroduceFragment();
listFragment = new ListFragment();
listFragment = new ListFragment(lessonOid);
switch (v.getId()) {
case R.id.tv_introduce:
... ...
package com.hh.xuetubao.activity.study;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.dou361.ijkplayer.listener.OnShowThumbnailListener;
import com.dou361.ijkplayer.widget.IjkVideoView;
import com.dou361.ijkplayer.widget.PlayStateParams;
import com.dou361.ijkplayer.widget.PlayerView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.OptimizeViewpager;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.bean.ChapterLstBean;
import com.hh.xuetubao.bean.Event;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.fragment.IntroduceFragment;
import com.hh.xuetubao.fragment.ListFragment;
import com.hh.xuetubao.model.LearnModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;
/**
* 课程详情
*/
public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter, LearnModel> implements ICommonView, View.OnClickListener {
private String lessonOid;
private String accountOid;
PlayerView play;
OptimizeViewpager pager;
FrameLayout course_A, course_B, back;
TextView start;
String playUrl; // = "http://dat.prepro.pq1959.com/lesson/274A9F7C-5A2D-4123-A97E-82F4A49D9BD8/XTBRES/C9696D55-660A-418C-86C8-858C3E919AD9/VIDEO/720.mp4";
private List<Fragment> fragmentList = new ArrayList<>();
MyViewPagerAdapter pagerAdapter;
TextView introduce, tv_list;
@Override
public void initView() {
EventBus.getDefault().register(this);
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
lessonOid = getIntent().getExtras().getString("lessonOid");
Log.e("AccountOid", "AccountOid " + accountOid + "," + "lessonOid" + lessonOid);
course_A = this.findViewById(R.id.course_A); // 视频
course_B = this.findViewById(R.id.course_B); // 初始
back = this.findViewById(R.id.course_detail_back); // 退回
start = this.findViewById(R.id.course_detail_start); // 开始学习
pager = this.findViewById(R.id.pager);
introduce = this.findViewById(R.id.tv_introduce); // 介绍
tv_list = this.findViewById(R.id.tv_list); // 目录
start.setOnClickListener(this);
back.setOnClickListener(this);
introduce.setOnClickListener(this);
tv_list.setOnClickListener(this);
fragmentList.add(new IntroduceFragment());
fragmentList.add(new ListFragment(lessonOid));
pagerAdapter = new MyViewPagerAdapter(getSupportFragmentManager());
pager.setOffscreenPageLimit(2);//设置ViewPage缓存界面数
pager.setAdapter(pagerAdapter);
pager.setCurrentItem(1); // 直接定位目录
tv_list.setTextColor(getResources().getColor(R.color.color_ff5400));
introduce.setTextColor(getResources().getColor(R.color.color_616161));
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
switch (position) {
case 0:
introduce.setTextColor(getResources().getColor(R.color.color_ff5400));
tv_list.setTextColor(getResources().getColor(R.color.color_616161));
break;
case 1:
tv_list.setTextColor(getResources().getColor(R.color.color_ff5400));
introduce.setTextColor(getResources().getColor(R.color.color_616161));
break;
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@Override
protected void onResume() {
super.onResume();
}
@Override
public int initLayout() {
return R.layout.activity_course_detail_two;
}
@Override
public void initData() {
mPresenter.getPresenter(3, 1, "", lessonOid);
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public LearnModel getModel() {
return new LearnModel();
}
@Override //添加,避免旋转屏幕之后只显示半个屏幕
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (play != null) {
play.onConfigurationChanged(newConfig);
}
}
@Override
public void getData(Object o, int api, int intent) {
if (api == 3 && intent == 1) {
ChapterLstBean bean = (ChapterLstBean) o;
Log.e("bean", bean.toString());
playUrl = bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl(); // html
Log.e("player", playUrl);
}
/* 发送消息 */
if (api == 6 && intent == 1) {
UserBean userBean = (UserBean) o;
if (userBean.getSuccess() == true) {
Log.e("Course_Success", "发送成功");
} else {
Log.e("Course_fail", "发送失败");
}
handler.removeCallbacksAndMessages(null); // 关闭线程
}
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.course_detail_back: // 返回
this.finish();
break;
case R.id.course_detail_start: // 开始学习
playVideo(playUrl);
break;
case R.id.tv_introduce: // 介绍
pager.setCurrentItem(0, true);
introduce.setTextColor(getResources().getColor(R.color.color_ff5400));
tv_list.setTextColor(getResources().getColor(R.color.color_616161));
break;
case R.id.tv_list: // 目录
pager.setCurrentItem(1, true);
tv_list.setTextColor(getResources().getColor(R.color.color_ff5400));
introduce.setTextColor(getResources().getColor(R.color.color_616161));
break;
}
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Override
protected void onStop() {
super.onStop();
if (play != null) {
play.stopPlay();
}
}
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void handleEvent(Event event) {
if (event.getCode() == 1) {
onResumeJC(event); // 先发送
playVideo(event.getPlayUrl()); // 播放视频
}
if (event.getCode() == 2) {
final String urlA = event.getPlayUrl();
play = new PlayerView(this)
.setTitle("视频")
.setScaleType(PlayStateParams.fitparent)
.hideMenu(true)
.forbidTouch(false)
.showThumbnail(new OnShowThumbnailListener() {
@Override
public void onShowThumbnail(ImageView ivThumbnail) {
switch (urlA.substring(urlA.length() - 3, urlA.length()).trim()) {
case "tml":
Toast.makeText(CourseDetailActivity_Video.this, "链接需网页打开", Toast.LENGTH_SHORT).show();
break;
default: // mp4 , wav ..
ivThumbnail.setImageBitmap(getNetVideoBitmap(urlA));
break;
}
}
})
.setPlaySource((urlA.substring(urlA.length() - 3, urlA.length())).trim().equals("tml") ? "" : urlA)
.startPlay();
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
}
}
// 播放视频
private void playVideo(final String url) {
play = new PlayerView(this)
.setTitle("视频")
.setScaleType(PlayStateParams.fitparent)
.hideMenu(true)
.forbidTouch(false)
.showThumbnail(new OnShowThumbnailListener() {
@Override
public void onShowThumbnail(ImageView ivThumbnail) {
switch (url.substring(url.length() - 3, url.length()).trim()) {
case "tml":
Toast.makeText(CourseDetailActivity_Video.this, "链接需网页打开", Toast.LENGTH_SHORT).show();
break;
default: // mp4 , wav ..
ivThumbnail.setImageBitmap(getNetVideoBitmap(url));
break;
}
}
})
.setPlaySource((url.substring(url.length() - 3, url.length())).trim().equals("tml") ? "" : url)
.startPlay();
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 1:
break;
}
}
};
public void onResumeJC(final Event event) {
Runnable runnable = new Runnable() {
int duration;
int playing;
@Override
public void run() {
try {
playing = play.getCurrentPosition();
duration = (int) play.getDuration();
Log.e("Course_Play", "playing:" + playing + ", duration:" + duration);
String s = refreshTime();
Log.e("Course_refresh", s + "");
mPresenter.getPresenter(6,
1,
accountOid,
event.getLessonOid(),
event.getChapterOid(),
event.getSectionOid(),
event.getResourceOid(),
String.valueOf(playing / 1000),
String.valueOf(playing / 1000),
String.valueOf(duration / 1000)
);
Message msg = new Message();
msg.what = 1;
handler.sendMessage(msg);
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
};
handler.post(runnable);
}
//视频开始播放时使用handle.sendMessageDelayed更新时间显示
private String refreshTime() {
int totalSeconds = play.getCurrentPosition() / 1000;
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
int hours = totalSeconds / 3600;
String ti = hours > 0 ? String.format("%02d:%02d:%02d", hours, minutes, seconds) : String.format("%02d:%02d", minutes, seconds);
return ti;
}
public static Bitmap getNetVideoBitmap(String videoUrl) {
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
//根据url获取缩略图
retriever.setDataSource(videoUrl, new HashMap());
//获得第一帧图片
bitmap = retriever.getFrameAtTime();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} finally {
retriever.release();
}
return bitmap;
}
public class MyViewPagerAdapter extends FragmentPagerAdapter {
public MyViewPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return fragmentList.get(position);
}
@Override
public int getCount() {
return fragmentList.size();
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
// super.destroyItem(container, position, object);
}
}
}
... ...
... ... @@ -122,7 +122,6 @@ public class StudyNoteActivity extends BaseMvpActivity<CommonPresenter, LearnMod
rlBody.setOnClickListener(this);
}
@Override
... ... @@ -259,7 +258,7 @@ public class StudyNoteActivity extends BaseMvpActivity<CommonPresenter, LearnMod
@Override
public void turn(String LessonOid) {
Intent intent = new Intent(this, CourseDetailActivity.class);
Intent intent = new Intent(this, CourseDetailActivity_Video.class);
intent.putExtra("lessonOid", LessonOid);
startActivity(intent);
}
... ...
... ... @@ -85,6 +85,6 @@ public class VipActivity extends BaseMvpActivity<CommonPresenter, MainModel> imp
@Override
public void turnDetail(int position) {
startActivity(new Intent(this, CourseDetailActivity.class));
startActivity(new Intent(this, CourseDetailActivity_Video.class));
}
}
... ...
... ... @@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
... ... @@ -34,14 +35,22 @@ public class ListRecChildAdapter extends RecyclerView.Adapter<ListRecChildAdapte
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
List<ChapterLstBean.ResourceLstObject> resourceLst = list.get(position).getResourceLst();
if (list.get(position).getSectionName() != null)
holder.textView.setText(list.get(position).getSectionName());
holder.textView.setText("第" + (position + 1) + "节 " + list.get(position).getSectionName());
final ListRecSecondChildAdapter childAdapter = new ListRecSecondChildAdapter(resourceLst, context);
childAdapter.setOnItemListener(new ListRecSecondChildAdapter.OnItemListener() {
@Override
public void setChecked(int pos) {
childAdapter.notifyDataSetChanged();
}
});
ListRecSecondChildAdapter childAdapter = new ListRecSecondChildAdapter(resourceLst, context);
holder.recChild.setLayoutManager(new LinearLayoutManager(context));
holder.recChild.setAdapter(childAdapter);
... ... @@ -49,6 +58,8 @@ public class ListRecChildAdapter extends RecyclerView.Adapter<ListRecChildAdapte
childAdapter.setLessonOid(lessonOid);
childAdapter.setSectionOid(list.get(position).getSectionOid());
childAdapter.notifyDataSetChanged();
}
@Override
... ... @@ -75,4 +86,5 @@ public class ListRecChildAdapter extends RecyclerView.Adapter<ListRecChildAdapte
public void setChapterOid(String chapterOid) {
this.chapterOid = chapterOid;
}
}
... ...
package com.hh.xuetubao.adapter;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
... ... @@ -37,13 +38,13 @@ public class ListRecGroupAdapter extends RecyclerView.Adapter<ListRecGroupAdapte
@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
String s = numberToChinese(position + 1);
if (list.get(position).getChapterName() != null)
holder.textView.setText(list.get(position).getChapterName());
holder.textView.setText(s + "、" + list.get(position).getChapterName());
List<ChapterLstBean.SectionLstObject> sectionLst = list.get(position).getSectionLst();
ListRecChildAdapter childAdapter = new ListRecChildAdapter(context, sectionLst);
final ListRecChildAdapter childAdapter = new ListRecChildAdapter(context, sectionLst);
holder.recChild.setAdapter(childAdapter);
holder.recChild.setLayoutManager(new LinearLayoutManager(context));
... ... @@ -51,13 +52,18 @@ public class ListRecGroupAdapter extends RecyclerView.Adapter<ListRecGroupAdapte
childAdapter.setChapterOid(list.get(position).getChapterOid());
childAdapter.notifyDataSetChanged();
holder.imgDowm.setOnClickListener(new View.OnClickListener() {
final Drawable shang = context.getResources().getDrawable(R.mipmap.shang);
final Drawable down = context.getResources().getDrawable(R.mipmap.down);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (clickDowm) {
holder.recChild.setVisibility(View.GONE);
holder.imgDowm.setBackgroundDrawable(shang);
} else {
holder.recChild.setVisibility(View.VISIBLE);
holder.imgDowm.setBackgroundDrawable(down);
}
clickDowm = !clickDowm;
}
... ... @@ -88,5 +94,82 @@ public class ListRecGroupAdapter extends RecyclerView.Adapter<ListRecGroupAdapte
this.lessonOid = lessonOid;
}
private static String nums[] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
private static String pos_units[] = {"", "十", "百", "千"};
private static String weight_units[] = {"", "万", "亿"};
/**
* 数字转汉字【新】
*
* @param num
* @return
*/
public static String numberToChinese(int num) {
if (num == 0) {
return "零";
}
int weigth = 0;//节权位
String chinese = "";
String chinese_section = "";
boolean setZero = false;//下一小节是否需要零,第一次没有上一小节所以为false
while (num > 0) {
int section = num % 10000;//得到最后面的小节
if (setZero) {//判断上一小节的千位是否为零,是就设置零
chinese = nums[0] + chinese;
}
chinese_section = sectionTrans(section);
if (section != 0) {//判断是都加节权位
chinese_section = chinese_section + weight_units[weigth];
}
chinese = chinese_section + chinese;
chinese_section = "";
setZero = (section < 1000) && (section > 0);
num = num / 10000;
weigth++;
}
if ((chinese.length() == 2 || (chinese.length() == 3)) && chinese.contains("一十")) {
chinese = chinese.substring(1, chinese.length());
}
if (chinese.indexOf("一十") == 0) {
chinese = chinese.replaceFirst("一十", "十");
}
return chinese;
}
/**
* 将每段数字转汉子
* @param section
* @return
*/
public static String sectionTrans(int section) {
StringBuilder section_chinese = new StringBuilder();
int pos = 0;//小节内部权位的计数器
boolean zero = true;//小节内部的置零判断,每一个小节只能有一个零。
while (section > 0) {
int v = section % 10;//得到最后一个数
if (v == 0) {
if (!zero) {
zero = true;//需要补零的操作,确保对连续多个零只是输出一个
section_chinese.insert(0, nums[0]);
}
} else {
zero = false;//有非零数字就把置零打开
section_chinese.insert(0, pos_units[pos]);
section_chinese.insert(0, nums[v]);
}
pos++;
section = section / 10;
}
return section_chinese.toString();
}
}
... ...
package com.hh.xuetubao.adapter;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.hh.xuetubao.R;
... ... @@ -16,6 +19,8 @@ import org.greenrobot.eventbus.EventBus;
import java.util.List;
import butterknife.OnItemClick;
public class ListRecSecondChildAdapter extends RecyclerView.Adapter<ListRecSecondChildAdapter.ViewHolder> {
private List<ChapterLstBean.ResourceLstObject> list;
private Context context;
... ... @@ -24,6 +29,7 @@ public class ListRecSecondChildAdapter extends RecyclerView.Adapter<ListRecSecon
private String resourceOid;
private String sectionOid;
int change;
public ListRecSecondChildAdapter(List<ChapterLstBean.ResourceLstObject> list, Context context) {
this.list = list;
... ... @@ -39,22 +45,36 @@ public class ListRecSecondChildAdapter extends RecyclerView.Adapter<ListRecSecon
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) {
Drawable tv = context.getResources().getDrawable(R.mipmap.tv);
Drawable ppt = context.getResources().getDrawable(R.mipmap.ppt);
switch (list.get(position).getResourceType()) {
case 1: // ppt
holder.img.setBackground(ppt);
break;
case 2: // 视频
holder.img.setBackground(tv);
break;
}
if (list.get(position).getResourceName() != null) {
holder.content.setText(list.get(position).getResourceName());
holder.content.setText("1-" + (position+1) + list.get(position).getResourceName());
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//将视频URL发送至CourseDetailActivity
Event event = new Event(1, lessonOid,chapterOid,sectionOid,list.get(position).getResourceOid(),list.get(position).getPlayUrl());
Event event = new Event(1, lessonOid, chapterOid, sectionOid, list.get(position).getResourceOid(), list.get(position).getPlayUrl());
EventBus.getDefault().postSticky(event);
onItemListener.setChecked(position);
// holder.list_ycdh.setVisibility(View.VISIBLE);
// notifyDataSetChanged();
}
});
}
@Override
... ... @@ -65,10 +85,13 @@ public class ListRecSecondChildAdapter extends RecyclerView.Adapter<ListRecSecon
public class ViewHolder extends RecyclerView.ViewHolder {
private final TextView content;
private final ImageView img, list_ycdh;
public ViewHolder(View itemView) {
super(itemView);
content = (TextView) itemView.findViewById(R.id.content);
img = itemView.findViewById(R.id.img);
list_ycdh = itemView.findViewById(R.id.list_ycdh);
}
}
... ... @@ -85,4 +108,15 @@ public class ListRecSecondChildAdapter extends RecyclerView.Adapter<ListRecSecon
}
private OnItemListener onItemListener;
public void setOnItemListener(OnItemListener onItemListener) {
this.onItemListener = onItemListener;
}
public interface OnItemListener {
void setChecked(int pos);
}
}
... ...
... ... @@ -46,8 +46,17 @@ public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapte
if (time.get(position) != null)
holder.tvTime.setText(day.get(position));
ViewGroup.LayoutParams params = holder.longView.getLayoutParams();
params.height = 100;
holder.longView.setLayoutParams(params);
Log.e("SSsss",day.get(position)+"");
int a= Integer.valueOf(day.get(position).substring(day.get(position).length()-1,day.get(position).length()));
Log.e("a_Position",a+"");
params.height = a * 50;
if(a == 0){
holder.longView.setVisibility(View.GONE);
}else {
holder.longView.setLayoutParams(params);
}
// params.height = 100;
}
@Override
... ...
... ... @@ -69,6 +69,16 @@ public class ChapterLstBean implements Serializable {
public void setSectionLst(List<SectionLstObject> sectionLst) {
SectionLst = sectionLst;
}
@Override
public String toString() {
return "ChapterLstObject{" +
"ChapterOid='" + ChapterOid + '\'' +
", ChapterName='" + ChapterName + '\'' +
", ChapterDesc='" + ChapterDesc + '\'' +
", SectionLst=" + SectionLst +
'}';
}
}
public class SectionLstObject {
... ... @@ -99,6 +109,15 @@ public class ChapterLstBean implements Serializable {
public void setResourceLst(List<ResourceLstObject> resourceLst) {
ResourceLst = resourceLst;
}
@Override
public String toString() {
return "SectionLstObject{" +
"SectionOid='" + SectionOid + '\'' +
", SectionName='" + SectionName + '\'' +
", ResourceLst=" + ResourceLst +
'}';
}
}
public class ResourceLstObject {
... ... @@ -165,6 +184,19 @@ public class ChapterLstBean implements Serializable {
public void setResourceType(int resourceType) {
ResourceType = resourceType;
}
@Override
public String toString() {
return "ResourceLstObject{" +
"ResourceOid='" + ResourceOid + '\'' +
", ResourceType=" + ResourceType +
", IsLearningFinished=" + IsLearningFinished +
", PlayUrl='" + PlayUrl + '\'' +
", Progress=" + Progress +
", TotalDuration=" + TotalDuration +
", ResourceName='" + ResourceName + '\'' +
'}';
}
}
public class LastStudyInfoObject {
... ... @@ -195,5 +227,23 @@ public class ChapterLstBean implements Serializable {
public void setResourceOid(String resourceOid) {
ResourceOid = resourceOid;
}
@Override
public String toString() {
return "LastStudyInfoObject{" +
"ChapterOid='" + ChapterOid + '\'' +
", SectionOid='" + SectionOid + '\'' +
", ResourceOid='" + ResourceOid + '\'' +
'}';
}
}
@Override
public String toString() {
return "ChapterLstBean{" +
"IsSuccess=" + IsSuccess +
", ChapterLst=" + ChapterLst +
", LastStudyInfo=" + LastStudyInfo +
'}';
}
}
... ...
... ... @@ -16,6 +16,7 @@ import android.widget.ImageView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.CustomScrollView;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.CourseXrecAdapter;
import com.hh.xuetubao.bean.FreeCourseBean;
import com.hh.xuetubao.model.LearnModel;
... ... @@ -182,7 +183,7 @@ public class CourseFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
@Override
public void turnTo(String lessonOid) {
Intent intent = new Intent(getActivity(), CourseDetailActivity.class);
Intent intent = new Intent(getActivity(), CourseDetailActivity_Video.class); //CourseDetailActivity
intent.putExtra("lessonOid", lessonOid);
startActivity(intent);
}
... ...
... ... @@ -15,6 +15,7 @@ import android.widget.RelativeLayout;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.CurriculumScheduleRecAdapter;
import com.hh.xuetubao.bean.FreeCourseBean;
import com.hh.xuetubao.model.LearnModel;
... ... @@ -123,7 +124,7 @@ public class CurriculumScheduleFragment extends BaseMvpFragment<CommonPresenter,
@Override
public void turnToDetail(String lessonOid) {
Intent intent = new Intent(getActivity(), CourseDetailActivity.class);
Intent intent = new Intent(getActivity(), CourseDetailActivity_Video.class);
intent.putExtra("lessonOid", lessonOid);
startActivity(intent);
}
... ...
... ... @@ -20,6 +20,7 @@ import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.ListViewNesting;
import com.hh.xuetubao.activity.pratice.PracticeActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.activity.study.StudyActivity;
import com.hh.xuetubao.activity.work.CompanyActivity;
import com.hh.xuetubao.activity.work.CompanyDetailActivity;
... ... @@ -99,7 +100,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
gridHotLesson.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
intent = new Intent(getActivity(), CourseDetailActivity.class);
intent = new Intent(getActivity(), CourseDetailActivity_Video.class);
intent.putExtra("lessonOid", hotList.get(position).getLessonOid());
startActivity(intent);
}
... ... @@ -174,10 +175,10 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
model.getModel(this, 5, 1);
ExerciseModel exerciseModel = new ExerciseModel();
exerciseModel.getModel(this, 2, 1, "3");
exerciseModel.getModel(this, 2, 1, "4");
ZhaopinModel zhaopinModel = new ZhaopinModel();
zhaopinModel.getModel(this, 3, 1, "3");
zhaopinModel.getModel(this, 3, 1, "4");
}
@Override
... ... @@ -206,7 +207,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
questionList.addAll(bankLst);
questionAdapter.notifyDataSetChanged();
if (bankLst.size() >= 3) {
if (bankLst.size() > 4) {
tvMoreTi.setVisibility(View.VISIBLE);
} else {
tvMoreTi.setVisibility(View.GONE);
... ... @@ -218,7 +219,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
companyList.addAll(companyListBeans);
companyAdapter.notifyDataSetChanged();
if (companyListBeans.size() >= 3) {
if (companyListBeans.size() > 4) {
tvMoreQiye.setVisibility(View.VISIBLE);
} else {
tvMoreQiye.setVisibility(View.GONE);
... ...
... ... @@ -43,6 +43,12 @@ public class IntroduceFragment extends BaseMvpFragment<CommonPresenter, LearnMod
TextView tvJianjieShow;
@BindView(R.id.gridview)
GridView gridview;
@BindView(R.id.tv_learned)
TextView tvLearned;
@BindView(R.id.tv_jianjie)
TextView tvJianjie;
@BindView(R.id.line1)
View line1;
private String lessonOid;
private LearnModel model;
private List<String> list = new ArrayList<>();
... ... @@ -93,10 +99,23 @@ public class IntroduceFragment extends BaseMvpFragment<CommonPresenter, LearnMod
tvTitle.setText(bean.getLessonName());
if (bean.getDifficult() != null)
tvSort.setText(bean.getDifficult());
if (bean.getLessonDesc() != null)
if (bean.getLessonDesc() != null && !bean.getLessonDesc().equals("")) {
tvJianjieShow.setText(bean.getLessonDesc());
if (bean.getSkillLst() != null)
tvJianjie.setVisibility(View.VISIBLE);
line1.setVisibility(View.VISIBLE);
} else {
tvJianjie.setVisibility(View.GONE);
line1.setVisibility(View.GONE);
}
if (bean.getSkillLst() != null && bean.getSkillLst().size() > 0) // 学习技能
{
list.addAll(bean.getSkillLst());
tvLearned.setVisibility(View.VISIBLE);
} else {
tvLearned.setVisibility(View.GONE);
}
gridAdapter.notifyDataSetChanged();
if (bean.getLessonCoverUrl() != null) {
Event event = new Event(2, null, null, null, null, bean.getLessonCoverUrl());
... ...
package com.hh.xuetubao.fragment;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
... ... @@ -9,6 +10,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.hh.xuetubao.R;
import com.hh.xuetubao.adapter.ListRecChildAdapter;
import com.hh.xuetubao.adapter.ListRecGroupAdapter;
import com.hh.xuetubao.bean.ChapterLstBean;
import com.hh.xuetubao.model.LearnModel;
... ... @@ -28,6 +30,7 @@ import butterknife.Unbinder;
/**
* 目录Fragment
*/
@SuppressLint("ValidFragment")
public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> implements ICommonView {
... ... @@ -38,6 +41,11 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
private List<ChapterLstBean.ChapterLstObject> title = new ArrayList<>();
private ListRecGroupAdapter groupAdapter;
@SuppressLint("ValidFragment")
public ListFragment(String lessonOid) {
this.lessonOid = lessonOid;
}
@Override
public int getLayoutId() {
return R.layout.fragment_list;
... ... @@ -45,12 +53,12 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
@Override
public void initView(@Nullable Bundle savedInstanceState) {
lessonOid = getTag();
recGroup.setLayoutManager(new LinearLayoutManager(getActivity()));
groupAdapter = new ListRecGroupAdapter(title, getActivity());
groupAdapter.setLessonOid(lessonOid);
recGroup.setAdapter(groupAdapter);
}
@Override
... ... @@ -77,7 +85,6 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
title.addAll(chapterLst);
groupAdapter.notifyDataSetChanged();
// onSendPlayUrl(bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl());
}
}
... ... @@ -109,4 +116,7 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
super.onDestroyView();
unbinder.unbind();
}
}
... ...
... ... @@ -20,6 +20,7 @@ import com.hh.xuetubao.Utils.RecyclerViewSpacesItemDecoration;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.personal.InfromationActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.StudyTimeXrcAdapter;
import com.hh.xuetubao.adapter.StudyXrecAdapter;
import com.hh.xuetubao.bean.LearningRecordDataBean;
... ... @@ -216,7 +217,7 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
@Override
public void turn(String LessonOid) {
Intent intent = new Intent(getActivity(), CourseDetailActivity.class);
Intent intent = new Intent(getActivity(), CourseDetailActivity_Video.class);
intent.putExtra("lessonOid", LessonOid);
startActivity(intent);
}
... ...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_50" />
<solid android:color="@color/color_000000" />
</shape>
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.study.CourseDetailActivity">
>
<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
android:id="@+id/jiecao_Player"
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:id="@+id/aa"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/course_A"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<include
layout="@layout/simple_player_view_player"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_230" />
</FrameLayout>
<FrameLayout
android:id="@+id/course_B"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_230">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/video" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.7"
android:background="#000" />
<FrameLayout
android:id="@+id/course_detail_back"
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.6"
android:background="@drawable/circle_black" />
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:layout_gravity="center"
android:scaleType="fitXY"
android:src="@mipmap/back_white" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_20"
android:text="计算机专业导论之思维与系统"
android:textColor="@color/color_ffffff"
android:textSize="@dimen/sp_20"
android:textStyle="bold" />
<TextView
android:id="@+id/course_detail_start"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_28"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/coners_15_orange"
android:gravity="center"
android:text="开始学习"
android:textColor="@color/color_ffffff"
android:textSize="@dimen/sp_12" />
</FrameLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_44"
android:layout_below="@+id/aa"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_introduce"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="介绍"
android:textColor="#FF5400"
android:textSize="@dimen/sp_15" />
<View
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_14"
android:layout_gravity="center_vertical"
android:background="#D7D7D7" />
<TextView
android:id="@+id/tv_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="目录"
android:textColor="#616161"
android:textSize="@dimen/sp_15" />
</LinearLayout>
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@id/tab"
android:background="#D7D7D7" />
<!--<ScrollView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_below="@+id/line"-->
<!--android:scrollbars="none">-->
<!--<FrameLayout-->
<!--android:id="@+id/viewPager"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent" />-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent">-->
<com.hh.xuetubao.Utils.OptimizeViewpager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/line"></com.hh.xuetubao.Utils.OptimizeViewpager>
<!--</LinearLayout>-->
<!--</ScrollView>-->
</RelativeLayout>
\ No newline at end of file
... ...
... ... @@ -94,7 +94,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_10" />
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
/>
</RelativeLayout>
<LinearLayout
... ...
... ... @@ -7,8 +7,9 @@
<ScrollView
android:layout_width="match_parent"
android:scrollbars="none"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:scrollbars="none">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.ListFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.hh.xuetubao.Utils.RecyclerViewNesting
android:id="@+id/rec_group"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
</ScrollView>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_16"
>
<CheckBox
android:id="@+id/check"
... ... @@ -17,7 +24,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_50"
android:src="@mipmap/tv" />
android:background="@mipmap/tv" />
<LinearLayout
android:layout_width="match_parent"
... ... @@ -47,4 +54,6 @@
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:gravity="bottom|center_horizontal"
android:orientation="vertical"
>
<TextView
android:id="@+id/tv_day"
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_5"
android:text="12.10"
android:layout_above="@id/view_long"
android:text="4小时"
android:textColor="#FFFFFF" />
<View
... ... @@ -17,15 +19,17 @@
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_100"
android:layout_above="@+id/tv_day"
android:layout_marginLeft="@dimen/dp_5"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/dp_5"
android:background="@drawable/tall" />
<TextView
android:id="@+id/tv_time"
android:id="@+id/tv_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/view_long"
android:text="4小时"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_5"
android:text="12.10"
android:textColor="#FFFFFF" />
</RelativeLayout>
</LinearLayout>
... ...
... ... @@ -22,12 +22,12 @@
<ImageView
android:id="@+id/img_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_8"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_20"
android:src="@mipmap/down" />
android:background="@mipmap/down" />
</RelativeLayout>
... ... @@ -35,5 +35,7 @@
android:id="@+id/rec_child"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl" />
android:layout_below="@id/rl"
/>
</RelativeLayout>
... ...
... ... @@ -120,7 +120,7 @@
android:layout_toRightOf="@id/tv_recently"
android:text="2019/02/03 16:00:20"
android:textColor="#AAAAAA"
android:textSize="12sp" />
android:textSize="@dimen/sp_10" />
<View
android:layout_width="match_parent"
... ...

559 字节 | 宽: | 高:

855 字节 | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖

1.5 KB | 宽: | 高:

1.5 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖

1.7 KB | 宽: | 高:

2.3 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖