Skip to content

Commit

Permalink
Release v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KenChoi1992 committed Oct 12, 2016
1 parent 6058f34 commit 832cdc7
Show file tree
Hide file tree
Showing 27 changed files with 250 additions and 111 deletions.
4 changes: 2 additions & 2 deletions JChat/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.jchat.android"
android:versionCode="53"
android:versionName="1.3.1">
android:versionCode="54"
android:versionName="1.3.2">

<uses-sdk
android:minSdkVersion="9"
Expand Down
Binary file added JChat/libs/arm64-v8a/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/armeabi-v7a/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/armeabi/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/jmessage-android-1.4.2.jar
Binary file not shown.
Binary file added JChat/libs/mips/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/mips64/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/x86/libjpush220.so
Binary file not shown.
Binary file added JChat/libs/x86_64/libjpush220.so
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions JChat/res/drawable-hdpi/jpush_richpush_btn_selector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 获得焦点但未按下时的背景图片 -->
<item
android:state_focused="true"
android:state_enabled="true"
android:state_pressed="false"
android:drawable="@drawable/jpush_ic_richpush_actionbar_back" />
<!-- 按下时的背景图片 -->
<item
android:state_enabled="true"
android:state_pressed="true"
android:drawable="@android:color/darker_gray" />
<!-- 按下时的背景图片 -->
<item
android:state_enabled="true"
android:state_checked="true"
android:drawable="@android:color/darker_gray" />
<!-- 默认时的背景图片 -->
<item android:drawable="@drawable/jpush_ic_richpush_actionbar_back" />
</selector>
20 changes: 20 additions & 0 deletions JChat/res/drawable-hdpi/jpush_richpush_progressbar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

<!-- 背景 gradient是渐变,corners定义的是圆角 -->
<item android:id="@android:id/background">
<shape>
<solid android:color="#ffffff" />
</shape>
</item>

<!-- 进度条 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#4393ea" />
</shape>
</clip>
</item>

</layer-list>
21 changes: 9 additions & 12 deletions JChat/res/layout/activity_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,23 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/me_split_line_color"
android:visibility="gone"/>
android:background="@color/me_split_line_color"/>

<RelativeLayout
android:id="@+id/disturb_mode_rl"
style="@style/SettingItemStyle"
android:clickable="true"
android:visibility="gone"
>
style="@style/SettingItemStyle">

<TextView
style="@style/SettingItemTextStyle"
android:text="@string/dnd_sub_hit" />
android:text="@string/no_disturb_global_hit" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<io.jchat.android.view.SlipButton
android:id="@+id/global_no_disturb_setting"
android:layout_width="70dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:background="@drawable/arrow"/>
/>
</RelativeLayout>

<View
Expand Down
21 changes: 16 additions & 5 deletions JChat/res/layout/jpush_webview_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
android:id="@+id/rlRichpushTitleBar"
android:layout_width="match_parent"
android:layout_height="40.0dp"
android:background="#6b6b6b">
android:background="#29313a">

<ImageButton
android:id="@+id/imgRichpushBtnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/richpush_btn_selector" />
android:layout_marginLeft="9dp"
android:layout_marginRight="10dp"
android:background="@drawable/jpush_richpush_btn_selector" />

<ImageView
android:id="@+id/imgView"
Expand All @@ -25,20 +27,29 @@
android:layout_centerVertical="true"
android:layout_toRightOf="@id/imgRichpushBtnBack"
android:clickable="false"
android:src="@drawable/ic_richpush_actionbar_divider" />
android:src="@drawable/jpush_ic_richpush_actionbar_divider" />

<TextView
android:id="@+id/tvRichpushTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10.0dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="5dp"
android:layout_toRightOf="@id/imgView"
android:clickable="false"
android:text=" "
android:textSize="20sp" />
android:textSize="20sp"
android:textColor="#ffffff" />
</RelativeLayout>

<ProgressBar
android:id="@+id/pushPrograssBar"
android:layout_width="match_parent"
android:layout_height="1dp"
android:progress="0"
android:progressDrawable="@drawable/jpush_richpush_progressbar"
style="?android:attr/progressBarStyleHorizontal" />
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
6 changes: 4 additions & 2 deletions JChat/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<string name="about">关于</string>
<string name="demo_version_name">demo版本号:%s</string>
<string name="sdk_version">\nsdk版本号:</string>
<string name="about_date">\n6月3日</string>
<string name="about_date">\n6月28日</string>
<string name="add_to_friend">加为好友</string>
<string name="setting_username_hit">昵称</string>
<string name="setting_username_big_hit">更改名字</string>
Expand Down Expand Up @@ -195,7 +195,9 @@
<string name="receive_new_msg_vibration_hit">震动</string>
<string name="receive_new_msg_voice_hit">声音</string>
<string name="background_msg_remind_time">后台消息免打扰时段</string>
<string name="dnd_sub_hit">勿扰模式</string>
<string name="no_disturb_global_hit">全局免打扰</string>
<string name="set_no_disturb_global_succeed">全局免打扰设置成功</string>
<string name="remove_no_disturb_global_succeed">已移除全局免打扰</string>
<string name="all_day_remind_hit">全天提醒</string>
<string name="close_all_day_remind">关闭全天提醒后,消息只在设定时间内提醒</string>
<string name="disturb_description">开启后,在设定时间段内收到新消息将不会响铃或震动</string>
Expand Down
57 changes: 57 additions & 0 deletions JChat/src/io/jchat/android/activity/CropImageActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.media.ExifInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import java.io.IOException;

import cn.jpush.im.android.api.JMessageClient;
import cn.jpush.im.android.api.model.UserInfo;
import io.jchat.android.R;
Expand Down Expand Up @@ -40,7 +45,9 @@ protected void onCreate(Bundle savedInstanceState) {
mTitle.setText(this.getString(R.string.crop_image_title));
Intent intent = getIntent();
String path = intent.getStringExtra("filePath");
int degree = getBitmapDegree(path);
Bitmap bitmap = BitmapLoader.getBitmapFromFile(path, mWidth, mHeight);
bitmap = rotateBitmapByDegree(bitmap, degree);
Log.i("CropImageActivity", "mWidth * mHeight: " + mWidth + " * " + mHeight);
mImageView.setDrawable(new BitmapDrawable(getResources(), bitmap), 720, 720);

Expand All @@ -65,4 +72,54 @@ public void onClick(View v) {
}
});
}

/**
* 获取图片的旋转角度
*
* @param path 图片绝对路径
* @return 图片的旋转角度
*/
public static int getBitmapDegree(String path) {
int degree = 0;
try {
// 从指定路径下读取图片,并获取其EXIF信息
ExifInterface exifInterface = new ExifInterface(path);
// 获取图片的旋转信息
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_90:
degree = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
degree = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270:
degree = 270;
break;
}
} catch (IOException e) {
e.printStackTrace();
}
return degree;
}

/**
* 将图片按照指定的角度进行旋转
*
* @param bitmap 需要旋转的图片
* @param degree 指定的旋转角度
* @return 旋转后的图片
*/
public static Bitmap rotateBitmapByDegree(Bitmap bitmap, int degree) {
// 根据旋转角度,生成旋转矩阵
Matrix matrix = new Matrix();
matrix.postRotate(degree);
// 将原始图片按照旋转矩阵进行旋转,并得到新的图片
Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
}
return newBitmap;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void onClick(View view) {
finish();
}
});
mTitle.setText(mContext.getString(R.string.dnd_sub_hit));
mTitle.setText(mContext.getString(R.string.no_disturb_global_hit));
mMenuBtn.setVisibility(View.GONE);
mDisturbSwitchBtn.setOnChangedListener(R.id.disturb_mode_switch, this);
mDisturbSwitchBtn.setChecked(false);
Expand Down
6 changes: 5 additions & 1 deletion JChat/src/io/jchat/android/activity/FriendInfoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void onCreate(Bundle savedInstanceState) {
} else {
conv = JMessageClient.getGroupConversation(mGroupId);
GroupInfo groupInfo = (GroupInfo) conv.getTargetInfo();
mUserInfo = groupInfo.getGroupMemberInfo(mTargetId);
mUserInfo = groupInfo.getGroupMemberInfo(mTargetId, mTargetAppKey);
}

mFriendInfoView.initModule();
Expand Down Expand Up @@ -120,6 +120,10 @@ public String getUserName() {
return mUserInfo.getUserName();
}

public String getTargetAppKey() {
return mTargetAppKey;
}


//点击头像预览大图
public void startBrowserAvatar() {
Expand Down
Loading

0 comments on commit 832cdc7

Please sign in to comment.