作者 qin

Merge remote-tracking branch 'origin/master'

正在显示 65 个修改的文件 包含 967 行增加809 行删除
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="12">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="10" class="java.lang.String" itemvalue="android.annotation.Nullable" />
<item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="9" class="java.lang.String" itemvalue="android.annotation.NonNull" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
... ... @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
android {
/* signingConfigs {
release {
keyAlias 'FireControl'
keyPassword '11111111'
storeFile file('./FireControl.jks')
storePassword '11111111'
}
}*/
signingConfigs {
debug {
storeFile file('D:\\project\\huahang_project\\app\\xuetubao.jks')
storePassword '111111'
keyAlias = 'xuetubao'
keyPassword '111111'
}
}
compileSdkVersion 28
defaultConfig {
... ... @@ -82,7 +82,7 @@ dependencies {
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
/* implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'*/
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'*/
implementation 'com.android.support:recyclerview-v7:28.1.1'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'fm.jiecao:jiecaovideoplayer:5.5.2'
... ... @@ -92,11 +92,9 @@ dependencies {
implementation 'org.greenrobot:eventbus:3.1.1'
implementation files('libs/AMap3DMap_7.1.0_AMapSearch_7.1.0_AMapLocation_4.7.2_20191030.jar')
implementation 'com.youth.banner:banner:1.4.10'
// 微信
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
implementation 'com.zhy:okhttputils:2.4.1'
// implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
// implementation 'com.zhy:okhttputils:2.4.1'
//ijkplayer
implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
... ... @@ -106,22 +104,18 @@ dependencies {
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'
implementation 'com.hyman:flowlayout-lib:1.1.2'
//顶部导航栏
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'
implementation files('libs/umeng-share-wechat-simplify-6.9.2.jar')
}
... ...
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
... ... @@ -43,6 +43,20 @@
#保持泛型
-keepattributes Signature
#友盟
-keep class com.umeng.** {*;}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep public class [com.hh.xuetubao].R$*{
public static final int *;
}
#保持所有实现 Serializable 接口的类成员
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
... ...
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.hh.xuetubao">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission
android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore="ProtectedPermissions" />
<!-- 允许程序访问WiFi网络信息 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- 允许程序读写手机状态和身份 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- 允许程序访问CellID或WiFi热点来获取粗略的位置 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name=".MyApplication"
... ... @@ -68,6 +73,11 @@
<activity
android:name=".activity.personal.ResumeActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.study.WebActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.personal.MessageActivity"
android:screenOrientation="portrait" />
... ... @@ -150,8 +160,9 @@
<!-- 微信 -->
<activity
android:name=".wxapi.WXEntryActivity"
android:label="WXEntryActivity"
android:exported="true" />
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</application>
... ...
... ... @@ -52,16 +52,12 @@ public class MainActivity extends BaseMvpActivity<CommonPresenter, MainModel> im
getWindow().setNavigationBarColor(Color.parseColor("#fcfcfc"));
//状态栏颜色
getWindow().setStatusBarColor(Color.parseColor("#fcfcfc"));*/
homeFragment = new HomeFragment();
wrongFragment = new PraticeWrongFragment();
transaction = getSupportFragmentManager().beginTransaction();
if(homeFragment==null){
homeFragment=new HomeFragment();
transaction.add(R.id.frame, homeFragment);
}else{
transaction.show(homeFragment);
}
transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.frame, homeFragment);
// transaction.show(homeFragment);
transaction.commit();
rlHome.setChecked(true);
... ...
... ... @@ -2,8 +2,8 @@ package com.hh.xuetubao;
import android.app.Application;
import android.content.Context;
import com.hh.xuetubao.wxapi.WxLogin;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;
public class MyApplication extends Application {
... ... @@ -15,8 +15,18 @@ public class MyApplication extends Application {
super.onCreate();
sMyApplication = this;
WxLogin.initWx(this); // wx
/**
* 设置组件化的Log开关
* 参数: boolean 默认为false,如需查看LOG设置为true
*/
UMConfigure.setLogEnabled(true);
UMConfigure.init(this, "5dd8cf883fc195fb8d000b63", "学徒宝", UMConfigure.DEVICE_TYPE_PHONE, null);
}
{
PlatformConfig.setWeixin("wxcf11ff5e6b39916b", "1831891c2fe743e792b2290e822f29cc");
}
public static MyApplication getMyApplication() {
... ...
... ... @@ -23,6 +23,7 @@ import com.hh.xuetubao.bean.ResumeDetailBean;
import com.hh.xuetubao.bean.ResumedJobListBean;
import com.hh.xuetubao.bean.TranscriptBean;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.bean.WeixinBean;
import io.reactivex.Observable;
import retrofit2.http.Body;
... ... @@ -169,7 +170,7 @@ public interface MyServer {
* @return
*/
@GET("WeixinLogin")
Observable<UserBean> WeixinLogin(@Query("wxOpenId") String wxOpenId);
Observable<WeixinBean> WeixinLogin(@Query("wxOpenId") String wxOpenId, int logType);
/**
* 微信登录绑定接口
... ... @@ -190,7 +191,7 @@ public interface MyServer {
* @return
*/
@GET("AccountLogin")
Observable<UserBean> AccountLogin(@Query("account") String account, @Query("password") String password);
Observable<UserBean> AccountLogin(@Query("account") String account, @Query("password") String password,@Query("logType") int logtype);
@FormUrlEncoded
... ...
package com.hh.xuetubao.activity.login;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;
... ... @@ -8,7 +9,9 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.MainActivity;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.model.AccountModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
... ... @@ -38,6 +41,8 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel>
private CountDownTimer timer;
private int time = 60;
String openid;
@Override
public void initView() {
... ... @@ -50,7 +55,7 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel>
@Override
public void initData() {
openid = getIntent().getStringExtra("AccountOid");
}
@Override
... ... @@ -107,6 +112,9 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel>
case 3: // 绑定
UserBean bean1 = (UserBean) o;
if (bean1.getSuccess()) {
String accountOid = bean1.getAccountOid();
SharedPrefrenceUtils.saveString(this, "AccountOid", accountOid);
startActivity(new Intent(this, MainActivity.class));
Toast.makeText(this, "微信绑定成功", Toast.LENGTH_SHORT).show();
this.finish();
} else {
... ... @@ -149,7 +157,7 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel>
Toast.makeText(this, "手机号和验证码不可为空", Toast.LENGTH_LONG).show();
return;
} else {
mPresenter.getPresenter(1, 3, edPhone.getText().toString().trim(), edCode.getText().toString().trim()); // - > 绑定
mPresenter.getPresenter(1, 3, openid,edPhone.getText().toString().trim(), edCode.getText().toString().trim()); // - > 绑定
}
break;
case R.id.bdsj_fhdl: // - > 返回登录
... ...
... ... @@ -112,7 +112,7 @@ public class JgdlActivity extends BaseMvpActivity<CommonPresenter, AccountModel>
Toast.makeText(this, "用户名和密码不可为空", Toast.LENGTH_SHORT).show();
return;
} else {
mPresenter.getPresenter(1, 4, edYhm.getText().toString().trim(), edPas.getText().toString().trim());
mPresenter.getPresenter(1, 4, edYhm.getText().toString().trim(), edPas.getText().toString().trim(),"2"); // android 为 2
}
break;
case R.id.jgdl_fhdl: // - > 返回登录
... ...
... ... @@ -15,15 +15,16 @@ import com.hh.xuetubao.MainActivity;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.bean.WeixinBean;
import com.hh.xuetubao.model.AccountModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import com.hh.xuetubao.wxapi.WxLogin;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
... ... @@ -134,7 +135,19 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
Toast.makeText(this, bean.getErrorMsg(), Toast.LENGTH_LONG).show();
Toast.makeText(this, "登录失败", Toast.LENGTH_LONG).show();
}
}
if (api == 1 && intent == 6) {
WeixinBean weixinBean = (WeixinBean) o;
if (weixinBean.isIsBindWx() == true) { // 已经绑定
String accountOid = weixinBean.getAccountOid();
SharedPrefrenceUtils.saveString(this, "AccountOid", accountOid);
startActivity(new Intent(this, MainActivity.class));
} else {
Intent intent1 = new Intent(this, BdsjActivity.class);
intent1.putExtra("AccountOid", weixinBean.getAccountOid());
startActivity(intent1);
}
}
}
... ... @@ -155,14 +168,12 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
ButterKnife.bind(this);
}
IWXAPI api;
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.login:
if (isCellphone(edPhone.getText().toString()) && !TextUtils.isEmpty(edPhone.getText().toString()))
mPresenter.getPresenter(1, 2, edPhone.getText().toString(), edCode.getText().toString(),String.valueOf(2));
mPresenter.getPresenter(1, 2, edPhone.getText().toString(), edCode.getText().toString(), String.valueOf(2));
else
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
break;
... ... @@ -174,8 +185,9 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
break;
case R.id.img_wechat: // 微信
WxLogin.longWx();
// startActivity(new Intent(LoginActivity.this, BdsjActivity.class));
UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, authListener);
break;
case R.id.img_jigou: // 机构登录
startActivity(new Intent(LoginActivity.this, JgdlActivity.class));
... ... @@ -189,5 +201,48 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel
return matcher.matches();
}
// // 监听
UMAuthListener authListener = new UMAuthListener() {
@Override
public void onStart(SHARE_MEDIA platform) {
Toast.makeText(LoginActivity.this, "开始", Toast.LENGTH_LONG).show();
}
@Override
public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> map) {
if (map == null) {
Toast.makeText(LoginActivity.this, "请检查是否安装该应用", Toast.LENGTH_SHORT).show();
return;
}
for (String s : map.keySet()) {
Log.e("mapkeySet", s.toString());
}
String openid = map.get("openid"); // openid
String name = map.get("name"); // name
String gender = map.get("gender"); // 性别
String sex = "0";
if (!TextUtils.isEmpty(gender) && gender.equals("男")) {
sex = "1";
} else if (!TextUtils.isEmpty(gender) && gender.equals("女")) {
sex = "2";
}
//头像
String iconurl = map.get("iconurl");
Log.e("openid", openid + "");
// mPresenter.getPresenter(1, 6, openid, "2"); // android
}
@Override
public void onError(SHARE_MEDIA platform, int action, Throwable t) {
Log.e("Throwable", t.getMessage().toString());
}
@Override
public void onCancel(SHARE_MEDIA platform, int action) {
}
};
}
... ...
... ... @@ -57,6 +57,12 @@ public class InfromationActivity extends BaseMvpActivity<CommonPresenter, Person
Log.e("resumeOid", resumeOid + "");
String name = SharedPrefrenceUtils.getString(InfromationActivity.this, "UserName");
if(name != null){
tvName.setText(name);
tvUser.setText(name);
}
String reallHeader = SharedPrefrenceUtils.getString(this, "ReallHeader");
String headPic = SharedPrefrenceUtils.getString(this, "HeadPic");
if (!TextUtils.isEmpty(headPic)) {
... ... @@ -167,10 +173,16 @@ public class InfromationActivity extends BaseMvpActivity<CommonPresenter, Person
public void getData(Object o, int api, int intent) {
if (api == 3 && intent == 1) {
UserBean bean = (UserBean) o;
Log.e("UserBean",bean.toString());
String name = SharedPrefrenceUtils.getString(InfromationActivity.this, "UserName");
if (bean.getUserName() != null) {
level += 1;
tvName.setText(bean.getUserName());
tvUser.setText(bean.getUserName());
}else if(name != null){
tvName.setText(name);
tvUser.setText(name);
}
if (!TextUtils.isEmpty(bean.getCompany())) {
level += 1;
... ...
... ... @@ -103,7 +103,6 @@ public class PracticeActivity extends BaseMvpActivity<CommonPresenter, MainModel
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
... ...
... ... @@ -39,7 +39,6 @@ import butterknife.ButterKnife;
*/
public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.list_answer)
ListView listAnswer;
@BindView(R.id.tv_radio)
... ... @@ -104,7 +103,6 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
private double duoxuan;
private double panduan;
@Override
public void initView() {
... ...
package com.hh.xuetubao.activity.study;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
... ... @@ -281,7 +282,11 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
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();
// 跳转
// Intent intent = new Intent(CourseDetailActivity_Video.this, WebActivity.class);
// intent.putExtra("tml",urlA);
// startActivity(intent);
// Toast.makeText(CourseDetailActivity_Video.this, "链接需网页打开", Toast.LENGTH_SHORT).show();
break;
default: // mp4 , wav ..
ivThumbnail.setImageBitmap(getNetVideoBitmap(urlA));
... ... @@ -296,8 +301,13 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
time_video.setText(play.getDuration() + "");
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
if ((urlA.substring(urlA.length() - 3, urlA.length())).trim().equals("tml")) {
course_A.setVisibility(View.GONE);
course_B.setVisibility(View.VISIBLE);
}else {
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
}
}
... ... @@ -315,7 +325,12 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
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();
Intent intent = new Intent(CourseDetailActivity_Video.this, WebActivity.class);
intent.putExtra("tml",url);
startActivity(intent);
// Toast.makeText(CourseDetailActivity_Video.this, "链接需网页打开", Toast.LENGTH_SHORT).show();
break;
default: // mp4 , wav ..
ivThumbnail.setImageBitmap(getNetVideoBitmap(url));
... ... @@ -327,8 +342,14 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
.setPlaySource((url.substring(url.length() - 3, url.length())).trim().equals("tml") ? "" : url)
.startPlay();
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
if ((url.substring(url.length() - 3, url.length())).trim().equals("tml")) {
course_A.setVisibility(View.GONE);
course_B.setVisibility(View.VISIBLE);
}else {
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
}
}
private Handler handler = new Handler() {
... ...
... ... @@ -31,6 +31,7 @@ import com.hh.xuetubao.mvp.ICommonView;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
... ... @@ -76,6 +77,10 @@ public class StudyNoteActivity extends BaseMvpActivity<CommonPresenter, LearnMod
private String resumeOid;
private int totalPage;
List<Integer> arr = new ArrayList<>();
int max;
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void initView() {
... ... @@ -89,19 +94,16 @@ public class StudyNoteActivity extends BaseMvpActivity<CommonPresenter, LearnMod
xrecyclerview.setNestedScrollingEnabled(false);
scroll.setNestedScrollingEnabled(true);
LinearLayoutManager manager = new LinearLayoutManager(this);
manager.setOrientation(LinearLayoutManager.HORIZONTAL);
rvReadTime.setLayoutManager(manager);
xrcAdapter = new StudyTimeXrcAdapter(this, day, time);
xrcAdapter = new StudyTimeXrcAdapter(this, day, time, max);
rvReadTime.setAdapter(xrcAdapter);
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.RIGHT_DECORATION, 25);//右间距
rvReadTime.addItemDecoration(new RecyclerViewSpacesItemDecoration(stringIntegerHashMap));
scroll.setFocusable(false);
scroll.setFocusableInTouchMode(false);
... ... @@ -186,6 +188,12 @@ public class StudyNoteActivity extends BaseMvpActivity<CommonPresenter, LearnMod
day.addAll(datas);
time.addAll(categories);
for (int i = 0; i < day.size(); i++) {
arr.add(Integer.valueOf(day.get(i).substring(0, day.get(i).length() - 2)));
}
max = Collections.max(arr);
xrcAdapter.notifyDataSetChanged();
}
... ...
package com.hh.xuetubao.activity.study;
import android.annotation.SuppressLint;
import android.net.http.SslError;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.webkit.SslErrorHandler;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.hh.xuetubao.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class WebActivity extends AppCompatActivity {
@BindView(R.id.webview)
WebView webview;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
ButterKnife.bind(this);
initWebView(webview,getIntent().getStringExtra("tml"));
}
@SuppressWarnings("deprecation")
@SuppressLint("SetJavaScriptEnabled")
public static void initWebView(WebView webView, String webUrl) {
webView.requestFocus();
webView.setHorizontalScrollBarEnabled(false);
webView.setVerticalScrollBarEnabled(false);
WebSettings web = webView.getSettings();
web.setJavaScriptEnabled(true);
web.setBuiltInZoomControls(true);
web.setSupportZoom(true);
web.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
web.setUseWideViewPort(true);
web.setLoadWithOverviewMode(true);
web.setSavePassword(true);
web.setSaveFormData(true);
//web.setBlockNetworkImage(true);// 把图片加载放在最后来加载渲染
webView.loadUrl(webUrl);
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// 重写此方法表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边
view.loadUrl(url);
return true;
}
@Override
public void onReceivedSslError(WebView view,
SslErrorHandler handler, SslError error) {
// 重写此方法可以让webview处理https请求
handler.proceed();
}
});
}
}
... ...
... ... @@ -76,7 +76,6 @@ public class CertificationCourseDetailAdapter extends BaseAdapter {
TextView title = (TextView) view.findViewById(R.id.title);
ListView lv = (ListView) view.findViewById(R.id.lv_content);
List<DoExerciseBean.bean> catalogLst = list.get(position).getSubCatalogLst().get(position).getSubCatalogLst();
adapter = new CertificationCourseContentAdapter(catalogLst, context);
lv.setAdapter(adapter);
... ... @@ -87,7 +86,6 @@ public class CertificationCourseDetailAdapter extends BaseAdapter {
}
SharedPrefrenceUtils.putStringList(context, "CataLogLst", cataloglst);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
private Intent intent;
... ... @@ -96,16 +94,13 @@ public class CertificationCourseDetailAdapter extends BaseAdapter {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String oid = list.get(thisPosition).getSubCatalogLst().get(thisPosition).getSubCatalogLst().get(position).getCatalogOid();
String accountOid = SharedPrefrenceUtils.getString(context, "AccountOid");
if (type == 1) {
//认证课程
doRequestOne(accountOid, oid);
} else if (type == 2) {
//练习
String title = list.get(thisPosition).getSubCatalogLst().get(thisPosition).getSubCatalogLst().get(position).getCatalogName();
doRequestTwo(oid, accountOid, title);
}
}
});
... ...
... ... @@ -8,6 +8,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
... ... @@ -45,7 +46,7 @@ public class HomeCompanyAdapter extends BaseAdapter {
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
public View getView(final int position, View convertView, ViewGroup parent) {
View view = LayoutInflater.from(context).inflate(R.layout.lv_home_company, null);
... ... @@ -56,7 +57,7 @@ public class HomeCompanyAdapter extends BaseAdapter {
TextView count = (TextView) view.findViewById(R.id.job_count);
RecyclerView rec = (RecyclerView) view.findViewById(R.id.list_label);
View line = (View) view.findViewById(R.id.line);
RelativeLayout rela = view.findViewById(R.id.rela);
LinearLayoutManager manager = new LinearLayoutManager(context);
manager.setOrientation(LinearLayoutManager.HORIZONTAL);
... ... @@ -78,6 +79,23 @@ public class HomeCompanyAdapter extends BaseAdapter {
if (list.get(position).getPopularJobName() != null)
job.setText(list.get(position).getPopularJobName());
rela.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (turn != null) {
turn.turnTo(list.get(position).getCompanyOid());
}
}
});
job.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (turn != null) {
turn.turnToZw(list.get(position).getPopularJobOid());
}
}
});
if (list.size() > 3) {
if (position == 2) {
... ... @@ -94,14 +112,17 @@ public class HomeCompanyAdapter extends BaseAdapter {
}
/*job.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
*/
return view;
}
private Turn turn;
public void setTurn(Turn turn) {
this.turn = turn;
}
public interface Turn {
void turnTo(String CompanyOid);
void turnToZw(String id);
}
}
... ...
... ... @@ -25,7 +25,7 @@ public class RecruitmentLabelAdapter extends RecyclerView.Adapter<RecruitmentLab
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.list_label, null);
View view = LayoutInflater.from(context).inflate(R.layout.list_recruit_label, null);
ViewHolder holder = new ViewHolder(view);
return holder;
}
... ...
... ... @@ -10,7 +10,9 @@ import android.view.ViewGroup;
import android.widget.TextView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.pieview.PColumn;
import java.text.DecimalFormat;
import java.util.List;
public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapter.ViewHolder> {
... ... @@ -18,11 +20,14 @@ public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapte
private Context context;
private List<String> day;
private List<String> time;
int max;
public StudyTimeXrcAdapter(Context context, List<String> day, List<String> time) {
public StudyTimeXrcAdapter(Context context, List<String> day, List<String> time, int max) {
this.context = context;
this.day = day;
this.time = time;
this.max = max;
Log.e("maxValue1", "max" + max);
}
@NonNull
... ... @@ -35,22 +40,18 @@ public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapte
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
int a = Integer.valueOf(day.get(position).substring(0, day.get(position).length() - 2));
if (day.get(position) != null) {
holder.tvDay.setText(time.get(position));
}
if (time.get(position) != null) {
holder.tvTime.setText(day.get(position));
}
// if (time.get(position) != null) {
// holder.tvTime.setText(a + ""); //day.get(position)
// }
ViewGroup.LayoutParams params = holder.longView.getLayoutParams();
int a = Integer.valueOf(day.get(position).substring(day.get(position).length() - 1, day.get(position).length()));
if (a == 0) {
params.height = 0;
} else {
params.height = a * 30;
}
holder.longView.setLayoutParams(params);
String format = new DecimalFormat("0").format(max * 1.2);
holder.pColumn.setData(a, Integer.valueOf(new DecimalFormat("0").format(max * 1.2)));
}
... ... @@ -62,14 +63,16 @@ public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapte
public class ViewHolder extends RecyclerView.ViewHolder {
private final TextView tvDay;
private final TextView tvTime;
private final View longView;
// private final TextView tvTime;
private final PColumn pColumn;
// private final View longView;
public ViewHolder(View itemView) {
super(itemView);
tvDay = (TextView) itemView.findViewById(R.id.tv_day);
tvTime = (TextView) itemView.findViewById(R.id.tv_time);
longView = itemView.findViewById(R.id.view_long);
// tvTime = (TextView) itemView.findViewById(R.id.tv_time);
pColumn = itemView.findViewById(R.id.pcolum);
// longView = itemView.findViewById(R.id.view_long);
}
}
}
... ...
package com.hh.xuetubao.adapter;
import android.content.Context;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
... ... @@ -39,8 +41,10 @@ public class StudyXrecAdapter extends RecyclerView.Adapter<StudyXrecAdapter.View
holder.percent.setText(String.valueOf(list.get(position).getStudyPercent()));
if (list.get(position).getLatelyStudyTime() != null)
holder.time.setText(list.get(position).getLatelyStudyTime());
if (list.get(position).getLatelyResourceName() != null)
if (list.get(position).getLatelyResourceName() != null) {
// holder.resourse.setText(list.get(position).getLatelyResourceName());
holder.resourse.setText(list.get(position).getLatelyResourceName());
}
if (list.get(position).getCoverPic() != null)
Glide.with(context).load(list.get(position).getCoverPic()).into(holder.img);
... ... @@ -73,7 +77,7 @@ public class StudyXrecAdapter extends RecyclerView.Adapter<StudyXrecAdapter.View
title = (TextView) itemView.findViewById(R.id.title);
percent = (TextView) itemView.findViewById(R.id.tv_percent);
img = (ImageView) itemView.findViewById(R.id.img);
resourse = (TextView) itemView.findViewById(R.id.tv_resourse);
resourse = itemView.findViewById(R.id.tv_resourse);
}
}
... ... @@ -86,4 +90,24 @@ public class StudyXrecAdapter extends RecyclerView.Adapter<StudyXrecAdapter.View
public interface TurnTo {
void turn(String LessonOid);
}
/**
* 半角转换为全角
*
* @param input
* @return
*/
public static String ToDBC(String input) {
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == 12288) {// 全角空格为12288,半角空格为32
c[i] = (char) 32;
continue;
}
if (c[i] > 65280 && c[i] < 65375)// 其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
c[i] = (char) (c[i] - 65248);
}
return new String(c);
}
}
... ...
package com.hh.xuetubao.bean;
public class WeixinBean {
/**
* IsSuccess : true
* AccountOid : 16EA2C01-20E3-420D-AB4E-4E44F0539349
* IsBindWx : true
*/
private boolean IsSuccess;
private String AccountOid;
private boolean IsBindWx;
public boolean isIsSuccess() {
return IsSuccess;
}
public void setIsSuccess(boolean IsSuccess) {
this.IsSuccess = IsSuccess;
}
public String getAccountOid() {
return AccountOid;
}
public void setAccountOid(String AccountOid) {
this.AccountOid = AccountOid;
}
public boolean isIsBindWx() {
return IsBindWx;
}
public void setIsBindWx(boolean IsBindWx) {
this.IsBindWx = IsBindWx;
}
}
... ...
... ... @@ -91,7 +91,7 @@ public class CompanyMainFragment extends Fragment {
myLocationStyle.showMyLocation(true);
myLocationStyle.anchor(a, b);//设置定位蓝点图标的锚点方法
aMap.setMyLocationStyle(myLocationStyle);//设置定位蓝点的Style
//aMap.getUiSettings().setMyLocationButtonEnabled(true);设置默认定位按钮是否显示,非必需设置。
// aMap.getUiSettings().setMyLocationButtonEnabled(true);//设置默认定位按钮是否显示,非必需设置。
aMap.setMyLocationEnabled(true);// 设置为true表示启动显示定位蓝点,false表示隐藏定位蓝点并不进行定位,默认是false。
}
... ...
... ... @@ -29,6 +29,7 @@ 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;
import com.hh.xuetubao.activity.work.OfficeDetailActivity;
import com.hh.xuetubao.adapter.GridHomeHotAdapter;
import com.hh.xuetubao.adapter.HomeCompanyAdapter;
import com.hh.xuetubao.adapter.HomeQuestionAdapter;
... ... @@ -62,7 +63,7 @@ import io.reactivex.schedulers.Schedulers;
* 首页
*/
public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> implements ICommonView, View.OnClickListener {
public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> implements ICommonView, View.OnClickListener, HomeCompanyAdapter.Turn {
@BindView(R.id.grid_hotLesson)
... ... @@ -128,21 +129,21 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
/*intent = new Intent(getActivity(), PracticeActivity.class);
intent.putExtra("catalogOid", questionList.get(position).getCatalogOid());
startActivity(intent);*/
doRequestTwo(questionList.get(position).getCatalogOid(),accountOid,questionList.get(position).getCatalogName());
doRequestTwo(questionList.get(position).getCatalogOid(), accountOid, questionList.get(position).getCatalogName());
}
});
companyAdapter = new HomeCompanyAdapter(companyList, getActivity());
listCompany.setAdapter(companyAdapter);
listCompany.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
intent = new Intent(getActivity(), CompanyDetailActivity.class);
intent.putExtra("CompanyOid", companyList.get(position).getCompanyOid());
startActivity(intent);
}
});
companyAdapter.setTurn(this);
// listCompany.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//
// }
// });
imageList.add(getResources().getDrawable(R.drawable.bannerone));
... ... @@ -245,9 +246,9 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
hotList.addAll(beanLessonLst);
hotAdapter.notifyDataSetChanged();
if(beanLessonLst.size()>4){
if (beanLessonLst.size() > 4) {
tvMoreKe.setVisibility(View.VISIBLE);
}else{
} else {
tvMoreKe.setVisibility(View.GONE);
}
}
... ... @@ -344,4 +345,20 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
break;
}
}
@Override
public void turnTo(String CompanyOid) {
intent = new Intent(getActivity(), CompanyDetailActivity.class);
intent.putExtra("CompanyOid",CompanyOid); // companyList.get(position).getCompanyOid()
startActivity(intent);
}
@Override
public void turnToZw(String id) {
intent = new Intent(getActivity(), OfficeDetailActivity.class);
intent.putExtra("JobOid", id);
startActivity(intent);
}
}
... ...
... ... @@ -478,13 +478,13 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
}
});
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
popupWindow.setOutsideTouchable(true);
popupWindow.setTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
popupWindow.showAsDropDown(linCompany);
popupWindow.showAsDropDown(linRequire);
reset.setOnClickListener(new View.OnClickListener() {
@Override
... ...
... ... @@ -14,6 +14,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.hh.xuetubao.MainActivity;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.CustomScrollView;
import com.hh.xuetubao.Utils.RecyclerViewSpacesItemDecoration;
... ... @@ -31,6 +32,7 @@ import com.hh.xuetubao.mvp.ICommonView;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
... ... @@ -71,6 +73,9 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
private List<String> time = new ArrayList<>();
private String resumeOid;
List<Integer> arr = new ArrayList<>();
int max;
@Override
public int getLayoutId() {
... ... @@ -93,11 +98,12 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
xrecyclerview.setNestedScrollingEnabled(false);
scroll.setNestedScrollingEnabled(true);
// int max = Collections.max(arr);
LinearLayoutManager manager = new LinearLayoutManager(getActivity());
manager.setOrientation(LinearLayoutManager.HORIZONTAL);
rvReadTime.setLayoutManager(manager);
xrcAdapter = new StudyTimeXrcAdapter(getActivity(), day, time);
xrcAdapter = new StudyTimeXrcAdapter(getActivity(), day, time, max);
rvReadTime.setAdapter(xrcAdapter);
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
... ... @@ -167,7 +173,15 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
day.addAll(datas);
time.addAll(categories);
xrcAdapter.notifyDataSetChanged();
for (int i = 0; i < day.size(); i++) {
arr.add(Integer.valueOf(day.get(i).substring(0, day.get(i).length() - 2)));
}
max = Collections.max(arr);
Log.e("maxValue", max + "");
xrcAdapter = new StudyTimeXrcAdapter(getActivity(), day, time, max);
rvReadTime.setAdapter(xrcAdapter);
// xrcAdapter.notifyDataSetChanged();
}
}
... ... @@ -192,10 +206,15 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
case R.id.rl_user:
case R.id.rl_body:
// startActivity(new Intent(getActivity(), InfromationActivity.class));
MineFragment mineFragment = new MineFragment();
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.frame, mineFragment);
transaction.commit();
// MineFragment mineFragment = new MineFragment();
// FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
// transaction.replace(R.id.frame, mineFragment);
// transaction.commit();
// Intent intent = new Intent(getActivity(), MainActivity.class);
// intent.putExtra("Intenttag","4");
// startActivity(intent);
break;
}
}
... ...
... ... @@ -30,9 +30,12 @@ public class AccountModel implements ICommonModel {
if (api == 1 && intent == 4) { // - > 机构登录
jg_login(commonView, api, intent, params);
}
if(api == 1 && intent == 5){ // 忘记密码
if (api == 1 && intent == 5) { // 忘记密码
forget_pas(commonView, api, intent, params);
}
if (api == 1 && intent == 6) { // 微信登录
weixin_login(commonView, api, intent, params);
}
}
... ... @@ -55,7 +58,7 @@ public class AccountModel implements ICommonModel {
/* 验证码登录 */
private void mobileLogin(final ICommonView commonView, final int api, final int intent, String... params) {
if (api == 1 && intent == 2)
mServers.mobileLogin(params[0], params[1],Integer.valueOf(params[2]))
mServers.mobileLogin(params[0], params[1], Integer.valueOf(params[2]))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
... ... @@ -87,7 +90,7 @@ public class AccountModel implements ICommonModel {
/* 机构登录 */
private void jg_login(final ICommonView commonView, final int api, final int tag, String... params) {
if (api == 1 && tag == 4) {
mServers.AccountLogin(params[0], params[1])
mServers.AccountLogin(params[0], params[1], Integer.valueOf(params[2]))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
... ... @@ -116,4 +119,20 @@ public class AccountModel implements ICommonModel {
}
}
/* 微信登录 */
private void weixin_login(final ICommonView commonView, final int api, final int tag, String... params) {
if(api ==1 && tag == 6){
mServers.WeixinLogin(params[0], Integer.valueOf(params[1]))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
@Override
public void onNext(Object value) {
super.onNext(value);
commonView.getData(value, api, tag);
}
});
}
}
}
... ...
package com.hh.xuetubao.pieview;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.os.Build;
import android.view.Display;
import android.view.WindowManager;
/**
* Created by lixiaodaoaaa on 2016/10/18.
*/
public class DensityUtils {
public DensityUtils() {
}
public static int dipTopx(Context context, float dpValue) {
float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5F * (float) (dpValue >= 0.0F ? 1 : -1));
}
public static int pxTodip(Context context, float pxValue) {
float scale = context.getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5F);
}
public static int pxTosp(Context context, float pxValue, float fontScale) {
return (int) (pxValue / fontScale + 0.5F);
}
public static int spTopx(float spValue, float fontScale) {
return (int) (spValue * fontScale + 0.5F);
}
@SuppressLint({"NewApi"})
public static int[] getScreenSize(Context context) {
int[] screenSize = new int[2];
boolean measuredWidth = false;
boolean measuredheight = false;
Point size = new Point();
@SuppressLint("WrongConstant") WindowManager w = (WindowManager) context.getSystemService("window");
int measuredWidth1;
int measuredheight1;
if (Build.VERSION.SDK_INT >= 13) {
w.getDefaultDisplay().getSize(size);
measuredWidth1 = size.x;
measuredheight1 = size.y;
} else {
Display d = w.getDefaultDisplay();
measuredWidth1 = d.getWidth();
measuredheight1 = d.getHeight();
}
screenSize[0] = measuredWidth1;
screenSize[1] = measuredheight1;
return screenSize;
}
}
... ...
package com.hh.xuetubao.pieview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.GradientDrawable;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import com.hh.xuetubao.R;
/**************************************
* *** http://weibo.com/lixiaodaoaaa **
* *** create at 2017/5/18 23:45 ****
* ******* by:lixiaodaoaaa **********
**************************************/
public class PColumn extends View {
int MAX = 100;//最大
int corner = 40;
int corner_a = 0;
int data = 0;//显示的数
int tempData = 0;
int textPadding = 15;
Paint mPaint;
int mColor;
Context mContext;
public PColumn(Context context) {
super(context);
mContext = context;
}
public PColumn(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
mContext = context;
initPaint();
}
public PColumn(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
initPaint();
}
private void initPaint() {
mPaint = new Paint();
mPaint.setAntiAlias(true);
// mColor = mContext.getResources().getColor(R.color.colorPrimary);
//两个坐标形成变量,规定了渐变的方向和间距大小,着色器为镜像
LinearGradient linearGradient =new LinearGradient(0,0,0,500, getResources().getColor(R.color.end_color),getResources().getColor(R.color.start_Color), Shader.TileMode.CLAMP); //CLAMP 头部 MIRROR 中间
mPaint.setShader(linearGradient);
// mPaint.setStrokeWidth(50);
// mPaint.setColor(mColor);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
if (data == 0) {
mPaint.setTextSize(30); //getWidth() / 2
RectF oval3 = new RectF(0, getHeight() - DensityUtils.pxTodip(mContext, 0), getWidth(), getHeight());// 设置个新的长方形
canvas.drawRoundRect(oval3, DensityUtils.pxTodip(mContext, corner), DensityUtils.pxTodip(mContext, corner), mPaint);
canvas.drawText("0",
getWidth() * 0.5f - mPaint.measureText("0") * 0.5f,
getHeight() - DensityUtils.pxTodip(mContext, 20) - 2 * DensityUtils.pxTodip(mContext, textPadding),
mPaint);
return;
}
//防止数值很大的的时候,动画时间过长
int step = data / 100 + 1;
if (tempData < data - step) {
tempData = tempData + step;
} else {
tempData = data;
}
//画圆角矩形
String S = tempData + "";
//一个字和两,三个字的字号相同
if (S.length() < 4) {
mPaint.setTextSize(30); //
} else {
mPaint.setTextSize(30); //getWidth() / (S.length() - 1)
}
float textH = mPaint.ascent() + mPaint.descent();
float MaxH = getHeight() - textH - 2 * DensityUtils.pxTodip(mContext, textPadding);
//圆角矩形的实际高度
float realH = MaxH / MAX * tempData;
// RectF ovl4 = new RectF(0, 10, getWidth(), getHeight()); //getHeight() - realH
RectF oval3 = new RectF(0, getHeight() - realH, getWidth(), getHeight());// 设置个新的长方形
canvas.drawRoundRect(oval3, DensityUtils.pxTodip(mContext, corner_a), DensityUtils.pxTodip(mContext, corner_a), mPaint);
// canvas.drawRoundRect(ovl4, DensityUtils.pxTodip(mContext, corner_a), DensityUtils.pxTodip(mContext, corner_a), mPaint);
//写数字
canvas.drawText(S,
getWidth() * 0.5f - mPaint.measureText(S) * 0.5f,
getHeight() - realH - 2 * DensityUtils.pxTodip(mContext, textPadding),
mPaint);
if (tempData != data) {
postInvalidate();
}
// Paint paint = new Paint();
// paint.setStyle(Paint.Style.FILL);
// paint.setColor(getResources().getColor(R.color.colorBarBack));
// paint.setAntiAlias(true);
//
// int colors[] = {getResources().getColor(R.color.colorBarColor), getResources().getColor(R.color.colorGradientGreen)};
}
public void setData(int data, int MAX) {
this.data = data;
tempData = 0;
this.MAX = MAX;
postInvalidate();
}
}
... ...
/*
* Copyright 2016 GcsSloop
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Last modified 2016-10-02 00:36:00
*
*/
package com.hh.xuetubao.pieview;
import android.support.annotation.NonNull;
public class PieData {
// 用户关心数据
private String name; // 名字
private float value; // 数值
private float percentage; // 百分比
// 非用户关心数据
private int color = 0; // 颜色
private float angle = 0; // 角度
public PieData(@NonNull String name, @NonNull float value) {
this.name = name;
this.value = value;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getAngle() {
return angle;
}
public void setAngle(float angle) {
this.angle = angle;
}
public float getValue() {
return value;
}
public void setValue(float value) {
this.value = value;
}
public float getPercentage() {
return percentage;
}
public void setPercentage(float percentage) {
this.percentage = percentage;
}
}
... ...
package com.hh.xuetubao.wxapi;
import android.content.Context;
import android.widget.Toast;
/**
* Created by 14178 on 2018/1/19.
*/
public class UIUtils {
private static Context mContext;
public static void initContext(Context context) {
mContext = context;
}
public static void runOnUIToast(String str){
Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show();
}
}
package com.hh.xuetubao.wxapi;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.R;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.model.AccountModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import com.umeng.socialize.weixin.view.WXCallbackActivity;
import org.json.JSONException;
import org.json.JSONObject;
public class WXEntryActivity extends WXCallbackActivity {
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class WXEntryActivity extends BaseMvpActivity<CommonPresenter, AccountModel> implements ICommonView, IWXAPIEventHandler {
private static final int RETURN_MSG_TYPE_LOGIN = 1;
private static final int RETURN_MSG_TYPE_SHARE = 2;
private IWXAPI mWeixinAPI;
@BindView(R.id.ed_phone)
EditText edPhone;
@BindView(R.id.ed_code)
EditText edCode;
@BindView(R.id.tv_yanzheng)
TextView tvYanzheng;
@BindView(R.id.bdsj_sure)
TextView bdsjSure;
@BindView(R.id.bdsj_fhdl)
TextView bdsjFhdl;
private CountDownTimer timer;
private int time = 60;
@Override
public void initView() {
ButterKnife.bind(this);
mWeixinAPI = WXAPIFactory.createWXAPI(this, WxData.WEIXIN_APP_ID, true);
mWeixinAPI.handleIntent(this.getIntent(), this);
}
@Override
public int initLayout() {
return R.layout.activity_bdsj; // R.layout.activity_wxentry
}
@Override
public void initData() {
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public AccountModel getModel() {
return new AccountModel();
}
@Override
public void getData(Object o, int api, int intent) {
if (api != 1) {
return;
}
switch (intent) {
case 1: // 验证码
UserBean bean = (UserBean) o;
if (bean.getSuccess()) {
Toast.makeText(this, "验证码发送成功", Toast.LENGTH_LONG).show();
time = 60;
timer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
time--;
tvYanzheng.setText(String.valueOf(time) + "s");
tvYanzheng.setFocusable(false);
tvYanzheng.setFocusableInTouchMode(false);
tvYanzheng.setClickable(false);
try {
tvYanzheng.setText(String.valueOf(time) + "s");
tvYanzheng.setFocusable(false);
} catch (Exception e) {
Log.e("zhangtao", e.toString());
}
}
@Override
public void onFinish() {
tvYanzheng.setText("获取验证码");
tvYanzheng.setFocusable(true);
tvYanzheng.setFocusableInTouchMode(true);
tvYanzheng.setClickable(true);
time = 60;
}
}.start();
} else {
Toast.makeText(this, "验证码发送失败", Toast.LENGTH_SHORT).show();
}
break;
case 3: // 绑定
UserBean bean1 = (UserBean) o;
if (bean1.getSuccess()) {
Toast.makeText(this, "微信绑定成功", Toast.LENGTH_SHORT).show();
this.finish();
} else {
Toast.makeText(this, "微信绑定失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
@OnClick({R.id.tv_yanzheng, R.id.bdsj_sure, R.id.bdsj_fhdl})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_yanzheng: // - > 验证码
if (isCellphone(edPhone.getText().toString()))
mPresenter.getPresenter(1, 1, edPhone.getText().toString(), String.valueOf(1)); // 1 -> 微信或手机号码绑定时发送
else
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
break;
case R.id.bdsj_sure: // - > 确定
if (isCellphone(edPhone.getText().toString())) {
Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show();
return;
} else if (edPhone.getText().length() > 0 && edCode.getText().length() > 0) {
Toast.makeText(this, "手机号和验证码不可为空", Toast.LENGTH_LONG).show();
return;
} else {
mPresenter.getPresenter(1, 3, edPhone.getText().toString().trim(), edCode.getText().toString().trim()); // - > 绑定
}
break;
case R.id.bdsj_fhdl: // - > 返回登录
this.finish();
break;
}
}
public static boolean isCellphone(String str) {
Pattern pattern = Pattern.compile("^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$");
Matcher matcher = pattern.matcher(str);
return matcher.matches();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
mWeixinAPI.handleIntent(intent, this);//必须调用此句话
}
@Override
public void onReq(BaseReq baseReq) {
Log.e("-----", "onReq: " + baseReq);
finish();
}
@Override
public void onResp(BaseResp baseResp) {
Log.e("-----", "errStr: " + baseResp.errStr);
Log.e("-----", "openId: " + baseResp.openId);
Log.e("-----", "transaction: " + baseResp.transaction);
Log.e("-----", "errCode: " + baseResp.errCode);
Log.e("-----", "getType: " + baseResp.getType());
Log.e("-----", "checkArgs: " + baseResp.checkArgs());
switch (baseResp.errCode) {
case BaseResp.ErrCode.ERR_AUTH_DENIED:
case BaseResp.ErrCode.ERR_USER_CANCEL:
if (RETURN_MSG_TYPE_SHARE == baseResp.getType()) UIUtils.runOnUIToast("分享失败");
else UIUtils.runOnUIToast("登录失败");
break;
case BaseResp.ErrCode.ERR_OK:
switch (baseResp.getType()) {
case RETURN_MSG_TYPE_LOGIN:
//拿到了微信返回的code,立马再去请求access_token
String code = ((SendAuth.Resp) baseResp).code;
getAccess_token(code);
//就在这个地方,用网络库什么的或者自己封的网络api,发请求去咯,注意是get请求
Log.e("--------", "code: " + code);
// id_tv.setText("code: " + code); //
break;
case RETURN_MSG_TYPE_SHARE:
UIUtils.runOnUIToast("微信分享成功");
finish();
break;
}
break;
}
}
/**
* 获取openid accessToken值用于后期操作
*
* @param code 请求码
*/
private void getAccess_token(final String code) {
String path = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="
+ WxData.WEIXIN_APP_ID
+ "&secret="
+ WxData.APP_SECRET
+ "&code="
+ code
+ "&grant_type=authorization_code";
OkHttpUtils.get().url(path).build().execute(new StringCallback() {
@Override
public void onError(okhttp3.Call call, Exception e) {
}
@Override
public void onResponse(String response) {
Log.e("-----", "onResponse: " + response);
JSONObject jsonObject = null;
try {
jsonObject = new JSONObject(response);
String openid = jsonObject.getString("openid").toString().trim();
String access_token = jsonObject.getString("access_token").toString().trim();
getUserMesg(access_token, openid);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
/**
* 获取微信的个人信息
*
* @param access_token
* @param openid
*/
private void getUserMesg(final String access_token, final String openid) {
String path = "https://api.weixin.qq.com/sns/userinfo?access_token="
+ access_token
+ "&openid="
+ openid;
OkHttpUtils.get().url(path).build().execute(new StringCallback() {
@Override
public void onError(okhttp3.Call call, Exception e) {
}
@Override
public void onResponse(String response) {
Log.e("------", "全部数据: " + response);
JSONObject jsonObject = null;
try {
jsonObject = new JSONObject(response);
String nickname = jsonObject.getString("nickname");
int sex = Integer.parseInt(jsonObject.get("sex").toString());
String headimgurl = jsonObject.getString("headimgurl");
String openid1 = jsonObject.getString("openid");
Log.e("---", "用户基本信息:");
Log.e("---", "nickname:" + nickname);
// nickname_tv.setText("nickname: " +nickname);
Log.e("---", "sex: " + sex);
// sex_tv.setText("sex: " + sex + "");
Log.e("---", "headimgurl:" + headimgurl);
// startLoca(nickname, openid1);
} catch (JSONException e) {
e.printStackTrace();
UIUtils.runOnUIToast("登陆错误,请重新再试");
}
// finish();
}
});
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
}
... ...
package com.hh.xuetubao.wxapi;
/**
* XINHAO_HAN存储信息
*/
public class WxData {
/**
* 你的AppID
*
* 在此特别注意,本Demo只适用微信的登陆功能,并不能用到微信支付功能
*
* 在此注意,必须要和微信官网签名一致,否则调用不起来微信APP,
*
* 如果在你调用出错的情况下(微信APP死活不出来的情况下),请参阅作者简书网址 : https://www.jianshu.com/p/04ed0b65f3df
*
* 微信APP掉不出来:有以下原因:
*
* 1.签名不正确(APK所使用签名的MD5码) 签名MD5码不要有 : 如A0:5B:12:63.... ,要全部是小写(推荐)a05b1263...,这种形式的
*
* 2.APP_ID不正确
*
* 3.密匙不正确
*
* 4.包名不正确
*
* 不走回调WXEntryActivity
*
* 1.AndroidManifest.xml里没有配置
*
* <activity
* android:name=".wxapi.WXEntryActivity"
* android:exported="true"
* android:label="WXEntryActivity" />
* 2.必须是 你的包名.wxapi
* 如果你的所有信息填写正确,还是掉不起来微信,那就可能是微信服务器问题,请稍等3-5分钟,在尝试调用,否则就重复以上选项
* 大兄弟,记得细心一点哟~~~
*
*
*
*
*/
public static final String WEIXIN_APP_ID = "";
public static final String APP_SECRET = "";
/**
* 固定的
*
*/
public static final String SCOPE = "snsapi_userinfo";
public static final String STATE = "wechat_sdk_demo_test_neng";
}
package com.hh.xuetubao.wxapi;
import android.content.Context;
import android.widget.Toast;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
/**
* Created by 14178 on 2018/1/19.
*/
public class WxLogin {
public static IWXAPI api;
public static Context mContext;
/**
* 急的初始化
*
* @param context
*/
public static void initWx(Context context) {
UIUtils.initContext(context);
mContext = context;
api = WXAPIFactory.createWXAPI(context, WxData.WEIXIN_APP_ID, true);
api.registerApp(WxData.WEIXIN_APP_ID);
final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null);
// 将该app注册到微信
msgApi.registerApp(WxData.WEIXIN_APP_ID);
}
public static void longWx() {
if (mContext == null) {
Toast.makeText(mContext, "你没有初始化,请在Application中做初始化动作,请调用 initWx(context)方法", Toast.LENGTH_SHORT).show();
return;
}
if (!api.isWXAppInstalled()) {
Toast.makeText(mContext, "您还未安装微信客户端", Toast.LENGTH_SHORT).show();
return;
}
final SendAuth.Req req = new SendAuth.Req();
req.scope = WxData.SCOPE;
req.state = WxData.STATE;
api.sendReq(req);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:centerColor="#80FFFFFF"
... ... @@ -12,4 +13,5 @@
android:bottomRightRadius="0dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
\ No newline at end of file
... ...
... ... @@ -319,7 +319,7 @@
<ImageView
android:layout_width="@dimen/dp_11"
android:layout_height="@dimen/dp_13"
android:src="@mipmap/itemimg" />
android:src="@mipmap/jiaojuan" />
<TextView
android:layout_width="wrap_content"
... ... @@ -339,7 +339,9 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_20"
android:text="展开答题卡" />
android:text="展开答题卡"
android:visibility="visible"
/>
</RelativeLayout>
... ...
... ... @@ -237,7 +237,7 @@
android:layout_toLeftOf="@+id/img_work"
android:background="@null"
android:gravity="end"
android:text="华航唯实"
android:text="未填写"
android:textColor="#333333"
android:textCursorDrawable="@color/color_e5e5e5"
android:textSize="12sp" />
... ...
... ... @@ -46,7 +46,9 @@
android:background="@null"
android:hint="请输入手机号"
android:textColorHint="#C7C7C7"
android:textSize="12sp" />
android:textSize="12sp"
android:inputType="number"
/>
<View
android:id="@+id/line2"
... ...
... ... @@ -91,7 +91,8 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_readTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_60"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/webview"
></WebView>
</LinearLayout>
\ No newline at end of file
... ...
... ... @@ -69,15 +69,14 @@
android:layout_height="@dimen/dp_30"
android:layout_below="@+id/grid_hotLesson"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/stroke_gray"
android:gravity="center"
android:text="查看更多"
android:layout_marginTop="@dimen/dp_30"
android:textColor="#AAAAAA"
android:textSize="12sp"
/>
android:textSize="12sp" />
<View
android:id="@+id/line1"
... ... @@ -124,9 +123,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/lin_title1"
android:layout_marginTop="@dimen/dp_20"
android:scrollbars="none"
android:divider="@null"
/>
android:scrollbars="none" />
<TextView
android:id="@+id/tv_more_ti"
... ... @@ -181,16 +179,24 @@
android:background="#333333" />
</LinearLayout>
<!--<android.support.v7.widget.RecyclerView-->
<!--android:id="@+id/rv_company"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_below="@id/lin_title2"-->
<!--android:layout_marginTop="@dimen/dp_10"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--/>-->
<com.hh.xuetubao.Utils.ListViewNesting
android:id="@+id/list_company"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/lin_title2"
android:layout_marginTop="@dimen/dp_10"
android:scrollbars="none"
android:dividerHeight="@dimen/dp_0"
android:divider="@null"
/>
android:dividerHeight="@dimen/dp_0"
android:scrollbars="none" />
<TextView
android:id="@+id/tv_more_qiye"
... ...
... ... @@ -3,12 +3,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--android:layout_below="@+id/lin_title"-->
<ImageView
android:id="@+id/img"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_90"
android:layout_below="@+id/lin_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_20"
android:src="@mipmap/home_class" />
... ...
... ... @@ -2,12 +2,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:layout_below="@id/tv_topic"-->
<LinearLayout
android:id="@+id/lin_A"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:layout_below="@id/tv_topic"
android:layout_marginTop="15dp"
android:orientation="horizontal">
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_marginRight="@dimen/dp_15"
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_f8f8f8_3"
android:paddingTop="@dimen/dp_3"
android:paddingBottom="@dimen/dp_3"
android:text="民营"
android:textColor="#A9A9A9"
android:textSize="11sp"
android:paddingLeft="@dimen/dp_7"
android:paddingRight="@dimen/dp_7"
android:layout_marginTop="@dimen/dp_10"
/>
</LinearLayout>
\ No newline at end of file
... ...
... ... @@ -2,126 +2,133 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_below="@+id/lin_title2"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:src="@mipmap/ssa" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
<!--android:layout_below="@+id/lin_title2"-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/img"
android:text="上海鉴泉自动化科技有限公司"
android:textColor="#232323"
android:textSize="16sp" />
android:id="@+id/rela"
>
<TextView
android:id="@+id/address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/img"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/img"
android:text="广东 深圳市"
android:textColor="#232323"
android:textSize="14sp" />
<!--
<LinearLayout
android:id="@+id/lin_biaoqian1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/img"
<ImageView
android:id="@+id/img"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal">
android:src="@mipmap/ssa" />
<TextView
android:id="@+id/tv_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_five"
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/img"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/img"
android:text="上海鉴泉自动化科技有限公司"
android:textColor="#232323"
android:textSize="16sp" />
<TextView
android:id="@+id/address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/img"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/img"
android:text="广东 深圳市"
android:textColor="#232323"
android:textSize="14sp" />
<!--
<LinearLayout
android:id="@+id/lin_biaoqian1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
</LinearLayout>
-->
<android.support.v7.widget.RecyclerView
android:id="@+id/list_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/address"
android:layout_marginTop="@dimen/dp_20"
android:nestedScrollingEnabled="false" />
android:layout_below="@id/img"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textColor="#A9A9A9"
android:textSize="11sp" />
</LinearLayout>
-->
<android.support.v7.widget.RecyclerView
android:id="@+id/list_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/address"
android:layout_marginTop="@dimen/dp_20"
android:nestedScrollingEnabled="false" />
</RelativeLayout>
<View
android:id="@+id/line3"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@id/list_label"
android:layout_below="@id/rela"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
... ... @@ -195,9 +202,8 @@
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#d7d7d7"
android:layout_below="@+id/tv1"
android:layout_marginTop="@dimen/dp_15"
/>
android:background="#d7d7d7" />
</RelativeLayout>
... ...
... ... @@ -2,12 +2,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:layout_below="@id/tv_zhengshu"-->
<ImageView
android:id="@+id/img_zhengshu"
android:layout_width="@dimen/dp_105"
android:layout_height="@dimen/dp_75"
android:layout_below="@id/tv_zhengshu"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:src="@mipmap/zhengshu" />
... ...
... ... @@ -2,12 +2,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:layout_below="@id/tv_shixi"-->
<TextView
android:id="@+id/tv_company"
android:layout_width="@dimen/dp_180"
android:layout_height="wrap_content"
android:layout_below="@id/tv_shixi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_25"
android:text="北京华航唯实机器人科技..."
... ...
... ... @@ -3,12 +3,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:layout_below="@id/tv_peixun"-->
<TextView
android:id="@+id/tv_school"
android:layout_width="@dimen/dp_180"
android:layout_height="wrap_content"
android:layout_below="@id/tv_peixun"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_25"
android:text="华航筑梦"
... ...
... ... @@ -4,17 +4,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_370">
android:layout_height="@dimen/dp_370"
android:background="@color/color_ffffff"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_ffffff"
android:orientation="vertical">
<TextView
... ...
... ... @@ -7,7 +7,9 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_370">
android:layout_height="@dimen/dp_370"
android:background="@color/color_ffffff"
>
<LinearLayout
android:layout_width="match_parent"
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="bottom|center_horizontal"
android:orientation="vertical"
>
android:orientation="vertical">
<TextView
android:id="@+id/tv_time"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/view_long"
android:text="4小时"
android:textColor="#FFFFFF" />
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_35"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_8"
>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
android:layout_weight="1" />
<!--<TextView-->
<!--android:id="@+id/tv_time"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/dp_10"-->
<!--android:gravity="center"-->
<!--android:text="4小时"-->
<!--android:textColor="#FFFFFF" />-->
<com.hh.xuetubao.pieview.PColumn
android:id="@+id/pcolum"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_200"
android:layout_gravity="bottom|center_horizontal"
/>
</LinearLayout>
<View
android:id="@+id/view_long"
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_100"
android:layout_above="@+id/tv_day"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/dp_5"
android:background="@drawable/tall" />
<!--<View-->
<!--android:id="@+id/view_long"-->
<!--android:layout_width="@dimen/dp_10"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_above="@+id/tv_day"-->
<!--android:layout_gravity="bottom|center_horizontal"-->
<!--android:layout_marginBottom="@dimen/dp_30"-->
<!--android:background="@drawable/tall" />-->
<!--android:layout_marginBottom="@dimen/dp_5"-->
<TextView
android:id="@+id/tv_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_25"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_5"
android:layout_gravity="bottom"
android:text="12.10"
android:textColor="#FFFFFF" />
</LinearLayout>
</FrameLayout>
... ...
... ... @@ -2,11 +2,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:layout_below="@+id/tv_title"-->
<ImageView
android:id="@+id/img_one"
android:layout_width="@dimen/dp_21"
android:layout_height="@dimen/dp_21"
android:layout_below="@+id/tv_title"
android:layout_marginLeft="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_10"
android:src="@mipmap/tv" />
... ...
... ... @@ -9,6 +9,7 @@
android:layout_height="@dimen/dp_90"
android:src="@mipmap/ic_launcher"
android:scaleType="fitXY"
android:layout_marginTop="@dimen/dp_20"
/>
<LinearLayout
... ... @@ -16,6 +17,7 @@
android:layout_height="@dimen/dp_90"
android:orientation="vertical"
android:layout_toRightOf="@id/img"
android:layout_marginTop="@dimen/dp_20"
>
<TextView
... ... @@ -24,7 +26,7 @@
android:layout_height="wrap_content"
android:layout_alignTop="@id/img"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_24"
android:text="ABB初级工程师证书"
android:textColor="#555555"
android:textSize="15sp"
... ... @@ -36,14 +38,12 @@
android:layout_height="wrap_content"
android:layout_below="@id/tv_title"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_13"
android:layout_toRightOf="@+id/img"
android:text="2010.07-2018.06"
android:textColor="#AAAAAA"
android:textSize="12sp" />
</LinearLayout>
<View
... ...
... ... @@ -37,7 +37,6 @@
android:id="@+id/year"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="@dimen/dp_3"
... ...
... ... @@ -6,7 +6,9 @@
<FrameLayout
android:id="@+id/frame"
android:layout_width="@dimen/dp_165"
android:layout_height="@dimen/dp_93">
android:layout_height="@dimen/dp_93"
android:layout_marginRight="@dimen/dp_15"
>
<ImageView
android:id="@+id/img"
... ... @@ -96,13 +98,15 @@
android:layout_toRightOf="@id/tv_free"
android:text="机器人编程方式 拷贝"
android:textColor="#349DFF"
android:textSize="13sp" />
android:textSize="13sp"
android:maxLines="2"
/>
<TextView
android:id="@+id/tv_recently"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_free"
android:layout_below="@id/tv_resourse"
android:layout_marginLeft="@dimen/dp_9"
android:layout_marginTop="@dimen/dp_13"
android:layout_toRightOf="@id/frame"
... ... @@ -114,7 +118,7 @@
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_free"
android:layout_below="@id/tv_resourse"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_13"
android:layout_toRightOf="@id/tv_recently"
... ...
... ... @@ -30,5 +30,8 @@
<color name="color_b0b0b0">#b0b0b0</color>
<color name="color_tm">#80000000</color>
<color name="color_fee3e0">#FEE3E0</color>
<color name="start_Color">#33FFFFFF</color>
<color name="end_color">#ffffff</color>
</resources>
... ...
不能预览此文件类型
... ... @@ -7,9 +7,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.novoda:bintray-release:0.9'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
... ... @@ -19,6 +19,7 @@ allprojects {
repositories {
google()
jcenter()
}
}
... ...
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
... ...