Skip to content

Commit

Permalink
Merge pull request #97 from Bai-Jie/mergeMasterToRelease
Browse files Browse the repository at this point in the history
合并master分支到release分支
  • Loading branch information
bai-jie committed Dec 16, 2015
2 parents 2a0a012 + 38dca82 commit aa507a9
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 240 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [1.1.3] - 2015-12-16
### Fixed
- 修复无法播放视频的问题

## [1.1.2] - 2015-12-06
### Fixed
- 修复无法播放视频的问题
Expand Down Expand Up @@ -39,7 +43,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- 显示播放记录
- 搜索视频

[Unreleased]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.1.2...HEAD
[Unreleased]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.1.3...HEAD
[1.1.3]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.1.2...v1.1.3
[1.1.2]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/OptimalOrange/CoolTechnologies/compare/v1.0.0...v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</activity>

<activity
android:name=".ui.PlayYoukuVideoActivity"
android:name=".ui.SimpleWebViewActivity"
android:theme="@style/FullscreenTheme"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="sensorLandscape"/>
Expand Down
36 changes: 0 additions & 36 deletions app/src/main/assets/playvideo.html

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public void playVideo() {
case NO_ERROR:
// 保存播放历史
DBManager.getInstance(this).saveHistory(mVideo);
// 跳转到 PlayYoukuVideoActivity
PlayYoukuVideoActivity.start(this, mVideo.id);
// 跳转到 SimpleWebViewActivity
SimpleWebViewActivity.start(this, mVideo.link);
break;
case NO_WIFI_NETWORK:
new NoWifiNetworkDialogFragment()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.optimalorange.cooltechnologies.ui;

import com.optimalorange.cooltechnologies.R;
import com.umeng.analytics.MobclickAgent;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class SimpleWebViewActivity extends Activity {

/**
* 应当显示的页面的url<br/>
* Type: {@link String}
*/
public static final String EXTRA_KEY_LINK =
SimpleWebViewActivity.class.getName() + ".extra.KEY_VIDEO_LINK";

/** 用于重置{@link WebView}的空网页 */
private static final String URL_BLANK = "about:blank";

private String mLink;

private WebView mWebView;

public static Intent buildIntent(Context context, String link) {
final Intent result = new Intent(context, SimpleWebViewActivity.class);
result.putExtra(EXTRA_KEY_LINK, link);
return result;
}

public static void start(Context context, String link) {
context.startActivity(buildIntent(context, link));
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simple_web_view);

mLink = getIntent().getStringExtra(EXTRA_KEY_LINK);
if (mLink == null) {
throw new IllegalStateException("Please set url link with EXTRA_KEY_LINK");
}

mWebView = (WebView) findViewById(R.id.web_view);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new WebViewClient());
}

@Override
protected void onStart() {
super.onStart();
mWebView.loadUrl(mLink);
}

@Override
protected void onResume() {
super.onResume();
// call it because this didn't extend BaseActivity
MobclickAgent.onResume(this);
MobclickAgent.onPageStart(getClass().getSimpleName());

mWebView.onResume();
}

@Override
protected void onPause() {
mWebView.onPause();

MobclickAgent.onPageEnd(getClass().getSimpleName());
MobclickAgent.onPause(this);
super.onPause();
}

@Override
protected void onStop() {
mWebView.loadUrl(URL_BLANK);
super.onStop();
}

@Override
protected void onDestroy() {
final ViewParent parent = mWebView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(mWebView);
mWebView.destroy();
}
mWebView = null;
super.onDestroy();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.PlayYoukuVideoActivity"
tools:context="com.optimalorange.cooltechnologies.ui.SimpleWebViewActivity"
/>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
PROJECTS_GROUP=com.optimalorange.cooltechnologies
VERSION_NAME=1.1.2
VERSION_NAME=1.1.3

0 comments on commit aa507a9

Please sign in to comment.