Skip to content

Commit

Permalink
完成分享功能
Browse files Browse the repository at this point in the history
  • Loading branch information
郭文明 committed Sep 12, 2016
1 parent 4f9f625 commit d5c3ac6
Show file tree
Hide file tree
Showing 37 changed files with 406 additions and 421 deletions.
1 change: 1 addition & 0 deletions multiwindow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
25 changes: 25 additions & 0 deletions multiwindow/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
}
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions multiwindow/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/wenmingvs/Documents/Android/AndroidSDK/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.multiwindow;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
23 changes: 23 additions & 0 deletions multiwindow/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multiwindow">

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">


<meta-data
android:name="com.samsung.android.sdk.multiwindow.enable"
android:value="true" />
<meta-data
android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.STYLE"
android:value="fixedRatio" />
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true" />

</application>

</manifest>
3 changes: 3 additions & 0 deletions multiwindow/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">multiwindow</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.example.multiwindow;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include ':weiboSDK', ':swipebacklayout', ':sharesdk'
include ':weiboSDK', ':swipebacklayout', ':sharesdk', ':multiwindow'
include ':weiSwift'
Binary file removed sharesdk/libs/ShareSDK-Evernote-2.7.7.jar
Binary file not shown.
108 changes: 12 additions & 96 deletions sharesdk/src/main/assets/ShareSDK.xml
Original file line number Diff line number Diff line change
@@ -1,122 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<DevInfor>
<!--
说明:
1、表格中的第一项
<ShareSDK
AppKey="api20" />
是必须的,其中的AppKey是您在ShareSDK上注册的开发者帐号的AppKey
2、所有集成到您项目的平台都应该为其在表格中填写相对应的开发者信息,以新浪微博为例:
<SinaWeibo
Id="1"
SortId="1"
AppKey="568898243"
AppSecret="38a4f8204cc784f81f9f0daaf31e02e3"
RedirectUrl="http://www.mob.com"
Enable="true" />
其中的SortId是此平台在分享列表中的位置,由开发者自行定义,可以是任何整型数字,数值越大
越靠后AppKey、AppSecret和RedirectUrl是您在新浪微博上注册开发者信息和应用后得到的信息
Id是一个保留的识别符,整型,ShareSDK不使用此字段,供您在自己的项目中当作平台的识别符。
Enable字段表示此平台是否有效,布尔值,默认为true,如果Enable为false,即便平台的jar包
已经添加到应用中,平台实例依然不可获取。
各个平台注册应用信息的地址如下:
新浪微博 http://open.weibo.com
腾讯微博 http://dev.t.qq.com
QQ空间 http://connect.qq.com/intro/login/
微信好友 http://open.weixin.qq.com
Facebook https://developers.facebook.com
Twitter https://dev.twitter.com
人人网 http://dev.renren.com
开心网 http://open.kaixin001.com
搜狐微博 http://open.t.sohu.com
网易微博 http://open.t.163.com
豆瓣 http://developers.douban.com
有道云笔记 http://note.youdao.com/open/developguide.html#app
印象笔记 https://dev.evernote.com/
Linkedin https://developer.linkedin.com
FourSquare https://developer.foursquare.com/
搜狐随身看 https://open.sohu.com/
Flickr http://www.flickr.com/services/
Pinterest http://developers.pinterest.com/
Tumblr http://www.tumblr.com/developers
Dropbox https://www.dropbox.com/developers
Instagram http://instagram.com/developer#
VKontakte http://vk.com/dev
易信好友 http://open.yixin.im/
明道 http://open.mingdao.com/
Line http://media.line.me/zh-hant/
Pocket http://getpocket.com/developer/apps/new
KakaoTalk https://developers.kakao.com/
KakaoStory https://developers.kakao.com/
Plurk http://www.plurk.com/API
-->

<ShareSDK
AppKey = "16cfef9f446fa"/> <!-- 修改成你在sharesdk后台注册的应用的appkey"-->


<QZone
AppId="100371282"
AppKey="aed9b0303e3ed1e27bae87c33761161d"
Enable="true" />

<!--
Wechat微信和WechatMoments微信朋友圈的appid是一样的;
注意:开发者不能用我们这两个平台的appid,否则分享不了
微信测试的时候,微信测试需要先签名打包出apk,
sample测试微信,要先签名打包,keystore在sample项目中,密码123456
BypassApproval是绕过审核的标记,设置为true后AppId将被忽略,故不经过
审核的应用也可以执行分享,但是仅限于分享文字和图片,不能分享其他类型,
默认值为false。此外,微信收藏不支持此字段。
-->
<Wechat
Id="1"
AppId="wxede67531b591586b"
AppSecret="07c6b503d15c4f91ee58867aaa8a9db9"
BypassApproval="false"
SortId="1"
Enable="true" />

<WechatMoments
Id="2"
AppId="wxede67531b591586b"
AppSecret="07c6b503d15c4f91ee58867aaa8a9db9"
BypassApproval="false"
SortId="2"
Enable="true" />

<WechatFavorite
<WechatFavorite
Id="3"
AppId="wxede67531b591586b"
AppSecret="07c6b503d15c4f91ee58867aaa8a9db9"
SortId="3"
Enable="true" />

<!-- ShareByAppClient标识是否使用微博客户端分享,默认是false -->
<QQ
AppId="100371282"
AppKey="aed9b0303e3ed1e27bae87c33761161d"
<QQ
Id="4"
AppId="1105681946"
AppKey="PazrGdI2AoSng79g"
SortId="4"
ShareByAppClient="true"
Enable="true" />


<!--
在中国大陆,印象笔记有两个服务器,一个是沙箱(sandbox),一个是生产服务器(china)。
一般你注册应用,它会先让你使用sandbox,当你完成测试以后,可以到
http://dev.yinxiang.com/support/上激活你的ConsumerKey,激活成功后,修改HostType
为china就好了。至于如果您申请的是国际版的印象笔记(Evernote),则其生产服务器类型为
“product”。
如果目标设备上已经安装了印象笔记客户端,ShareSDK允许应用调用本地API来完成分享,但
是需要将应用信息中的“ShareByAppClient”设置为true,此字段默认值为false。
-->
<Evernote
HostType="sandbox"
ConsumerKey="sharesdk-7807"
ConsumerSecret="d05bf86993836004"
ShareByAppClient="true"
Enable="true" />


</DevInfor>
9 changes: 9 additions & 0 deletions sharesdk/src/main/java/com/wenming/sharesdk/ShareUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.wenming.sharesdk;

/**
* Created by wenmingvs on 16/9/12.
*/
public class ShareUtils {


}
38 changes: 22 additions & 16 deletions weiSwift/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
compileSdkVersion 24
buildToolsVersion '23.0.3'

defaultConfig {
Expand All @@ -18,37 +18,43 @@ android {
}

signingConfigs{
release {
storeFile file("weiswift_keystore.jks") //证书存放目录
storePassword "123456" //密码
keyAlias "China" //别名
keyPassword "123456" //密码(就是设置证书那两个密码,建议都填一样的)
}
}
buildTypes {
debug {
signingConfig signingConfigs.release
}
release {
signingConfig signingConfigs.release
storeFile file("debug.keystore") //证书存放目录
}
}

// signingConfigs{
// release {
// storeFile file("weiswift_keystore.jks") //证书存放目录
// storePassword "123456" //密码
// keyAlias "China" //别名
// keyPassword "123456" //密码(就是设置证书那两个密码,建议都填一样的)
// }
// }
// buildTypes {
// debug {
// signingConfig signingConfigs.release
// }
// release {
// signingConfig signingConfigs.release
// }
// }

}

dependencies {
compile project(':weiboSDK')
compile project(path: ':swipebacklayout')
compile project(path: ':sharesdk')
compile project(path: ':multiwindow')
compile files('libs/universal-image-loader-1.9.5.jar')
compile files('libs/sdk-v1.0.0.jar')
compile files('libs/multiwindow-v1.3.2.jar')


compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'


compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.code.gson:gson:2.4'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.github.wenmingvs:LogReport:1.0.3'
compile 'com.cesards.android:cropimageview:1.0.2.1'
Expand Down
12 changes: 0 additions & 12 deletions weiSwift/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize">

<meta-data
android:name="com.samsung.android.sdk.multiwindow.enable"
android:value="true" />
<meta-data
android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.STYLE"
android:value="fixedRatio" />
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true" />

<activity
android:name=".ui.welcome.WelcomeActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
ToastUtil.showShort(context, "保存文件失败,请检查SD卡是否已满!");
return;
}
SaveImgUtil.create(context).saveImage(imgFile, loadedImage);
if (url.endsWith(".gif")){
SaveImgUtil.create(context).saveImage(imgFile,".gif");
}else {
SaveImgUtil.create(context).saveImage(imgFile,"jpg");
}

}
});
}
Expand Down
Loading

0 comments on commit d5c3ac6

Please sign in to comment.