Skip to content

Commit

Permalink
V1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfusheng committed Apr 24, 2019
1 parent 95be7e9 commit ac9b9db
Show file tree
Hide file tree
Showing 78 changed files with 411 additions and 181 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ deploy:
provider: releases
api_key:
secure: BYgbTvgpuAcfbsRlU3zaGOddULelZdWYb2+7R7/2XnipLUd9MLp0QUyKSQ81LAlrvYOsH9UMP0DQu9OIzjcGsfP3Z9NDkgQjZZ6v3LNeiMcDlgCZy4oMAtk8EzvpvtzbXSGQ4T5RGgCy5d+dSQwpbTwhxo5vn6ad0MmZFxoZ8D+6DX52tMkgLdxDe+LWcGOowkXw88DTZKz5KqO0KcLsqowwL2/h0uNl3V1d72dEyxU7xSqNXctBua+DOyMVu9y0ZP0vu/tf98saTNCDyxSmZqLZ/Mq2iCdeX28C44m0+zKAds5UJFGxrcGJTbtW66visYkNrQuRrOoCHmyRZG3nGPiTKYNoxSZbQH00PJOlCrVSltQrhf4u/gHhB10KOgnK60OQRxj5ffMgGqJT0BTryiU4yqvw3KESElMWwdPni/VSZ0zEr9v5/WxhY2W9ZibJvbYDh5KjUP93B7CXw+9EjIW39OMmyTWV4KEX1ng5JXM0lykED+jKgyDeVUwyrZTxzOjxvh3oluv8KfnoHMggoUTQsLmYNp02gm+fS+eYLMMrp6Tu3SNtnm5lYuAav/pCr6+vQRwGC9NEWVHJhRc6IIVyjRjbXz/FwX5VtmVmgzWovL2aVDYWB+P5of80ymcD36GgsXO0ZdYGxTUky2+rQVza9yqniygjK0FPfcA/rfc=
file: Sample/release/MarqueeView.apk
file: demo/release/MarqueeView.apk
skip_cleanup: true
on:
repo: sunfusheng/MarqueeView
Expand All @@ -55,7 +55,7 @@ deploy:

after_deploy:
- "./gradlew clean build bintrayUpload -PbintrayUser=sfsheng0322 -PbintrayKey=$BINTRAY_TOKEN -PdryRun=false"
- fir p Sample/release/MarqueeView.apk -T $FIR_TOKEN -c "`git cat-file tag $TRAVIS_TAG`"
- fir p demo/release/MarqueeView.apk -T $FIR_TOKEN -c "`git cat-file tag $TRAVIS_TAG`"

notifications:
email:
Expand Down
25 changes: 0 additions & 25 deletions MarqueeView/build.gradle

This file was deleted.

26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MarqueeView [ ![Download](https://api.bintray.com/packages/sfsheng0322/maven/marqueeview/images/download.svg) ](https://bintray.com/sfsheng0322/maven/marqueeview/_latestVersion)
# MarqueeView [ ![MarqueeView](https://api.bintray.com/packages/sfsheng0322/maven/MarqueeView/images/download.svg) ](https://bintray.com/sfsheng0322/maven/MarqueeView/_latestVersion)

俗名:可垂直跑、可水平跑的跑马灯
学名:可垂直翻、可水平翻的翻页公告
Expand All @@ -9,7 +9,7 @@

#### Gradle:

compile 'com.sunfusheng:marqueeview:<latest-version>'
compile 'com.sunfusheng:MarqueeView:<latest-version>'

#### 属性

Expand All @@ -21,7 +21,8 @@
| mvTextColor | 文字颜色 |
| mvGravity | 文字位置:left、center、right |
| mvSingleLine | 单行设置 |
| mvDirection | 动画滚动方向:bottom_to_top、top_to_bottom、right_to_left、left_to_right |
| mvDirection | 动画滚动方向:bottom_to_top、top_to_bottom、right_to_left、left_to_right |
| mvFont | 设置字体 |

#### XML

Expand All @@ -34,7 +35,8 @@
app:mvInterval="3000"
app:mvTextColor="@color/white"
app:mvTextSize="14sp"
app:mvSingleLine="true"/>
app:mvSingleLine="true"
app:mvFont="@font/huawenxinwei"/>

#### 设置字符串列表数据

Expand All @@ -43,7 +45,7 @@
List<String> info = new ArrayList<>();
info.add("1. 大家好,我是孙福生。");
info.add("2. 欢迎大家关注我哦!");
info.add("3. GitHub帐号:sfsheng0322");
info.add("3. GitHub帐号:sunfusheng");
info.add("4. 新浪微博:孙福生微博");
info.add("5. 个人博客:sunfusheng.com");
info.add("6. 微信公众号:孙福生");
Expand Down Expand Up @@ -71,9 +73,11 @@

#### 重影问题可参考以下解决方案

在 Activity 或 Fragment 中

@Override
public void onStart() {
super.onStart();
super.onStart();
marqueeView.startFlipping();
}

Expand All @@ -82,7 +86,15 @@
super.onStop();
marqueeView.stopFlipping();
}


在 ListView 或 RecyclerView 的 Adapter 中

@Override
public void onViewDetachedFromWindow(@NonNull ViewHolder holder) {
super.onViewDetachedFromWindow(holder);
holder.marqueeView.stopFlipping();
}

<br/>

### 扫一扫[Fir.im](https://fir.im/MarqueeView)二维码下载APK
Expand Down
15 changes: 0 additions & 15 deletions Sample/src/main/res/drawable/drawable_list_item_selector.xml

This file was deleted.

Binary file removed Sample/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-xhdpi/ic_loudspeaker.png
Binary file not shown.
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-xxhdpi/ic_loudspeaker.png
Binary file not shown.
Binary file not shown.
Binary file removed Sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
6 changes: 0 additions & 6 deletions Sample/src/main/res/values-w820dp/dimens.xml

This file was deleted.

File renamed without changes.
24 changes: 13 additions & 11 deletions Sample/build.gradle → app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Properties signingProperties = new Properties()
signingProperties.load(new FileInputStream(file("../signings/signing.properties")))

android {
compileSdkVersion rootProject.compileSdkVersion
compileSdkVersion COMPILE_SDK_VERSION
defaultConfig {
applicationId "com.sunfusheng.sample"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode rootProject.versionCode
versionName rootProject.versionName
applicationId "com.sunfusheng.marqueeview.demo"
minSdkVersion MIN_SDK_VERSION
targetSdkVersion TARGET_SDK_VERSION
versionCode VERSION_CODE
versionName VERSION_NAME
multiDexEnabled true
}

Expand Down Expand Up @@ -49,13 +49,15 @@ def localSourceEnabled = true

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:' + rootProject.supportLibraryVersion
implementation 'com.android.support:design:' + rootProject.supportLibraryVersion
implementation 'com.android.support:recyclerview-v7:' + rootProject.supportLibraryVersion
implementation 'com.android.support:appcompat-v7:' + SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:design:' + SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:recyclerview-v7:' + SUPPORT_LIBRARY_VERSION

compile 'com.sunfusheng:FirUpdater:1.1.1'

if (localSourceEnabled) {
implementation project(':MarqueeView')
implementation project(':marqueeview')
} else {
implementation 'com.sunfusheng:marqueeview:' + rootProject.versionName
implementation 'com.sunfusheng:marqueeview:' + VERSION_NAME
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools"
package="com.sunfusheng.sample"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sunfusheng.marqueeview.demo">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".AboutActivity"/>
<activity android:name=".AboutActivity" />

</application>
</manifest>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sunfusheng.sample;
package com.sunfusheng.marqueeview.demo;

import android.annotation.SuppressLint;
import android.content.Context;
Expand Down Expand Up @@ -34,9 +34,9 @@ protected void onCreate(Bundle savedInstanceState) {
initView();
}

@SuppressLint("NewApi")
@SuppressLint("SetJavaScriptEnabled")
private void initView() {
webView = (WebView) findViewById(R.id.webView);
webView = findViewById(R.id.webView);
setTitle("关于(V" + getVersionName(this) + ")");

settings = webView.getSettings();
Expand Down Expand Up @@ -102,19 +102,17 @@ public boolean onCreateOptionsMenu(Menu menu) {

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && webView.canGoBack()) {
webView.goBack();//返回上一页面
webView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sunfusheng.sample.fragment;
package com.sunfusheng.marqueeview.demo;

import android.graphics.Color;
import android.os.Bundle;
Expand All @@ -15,7 +15,7 @@
import android.widget.Toast;

import com.sunfusheng.marqueeview.MarqueeView;
import com.sunfusheng.sample.R;
import com.sunfusheng.marqueeview.demo.R;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -43,10 +43,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

List<CharSequence> list = new ArrayList<>();
SpannableString ss1 = new SpannableString("1、MarqueeView开源项目");
ss1.setSpan(new ForegroundColorSpan(Color.RED), 2, 13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss1.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.red)), 2, 13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
list.add(ss1);
SpannableString ss2 = new SpannableString("2、GitHub:sfsheng0322");
ss2.setSpan(new ForegroundColorSpan(Color.GREEN), 9, 20, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
SpannableString ss2 = new SpannableString("2、GitHub:sunfusheng");
ss2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.blue)), 9, 19, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
list.add(ss2);
SpannableString ss3 = new SpannableString("3、个人博客:sunfusheng.com");
ss3.setSpan(new URLSpan("http://sunfusheng.com/"), 7, 21, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Expand All @@ -69,5 +69,4 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

return view;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sunfusheng.sample;
package com.sunfusheng.marqueeview.demo;

import android.content.Intent;
import android.os.Bundle;
Expand All @@ -8,31 +8,30 @@
import android.view.Menu;
import android.view.MenuItem;

import com.sunfusheng.sample.fragment.CommonFragment;
import com.sunfusheng.sample.fragment.RecyclerViewFragment;
import com.sunfusheng.sample.fragment.adapter.FragmentPagerItemAdapter;

import com.sunfusheng.FirUpdater;
import com.sunfusheng.marqueeview.demo.adapter.FragmentPagerItemAdapter;

public class MainActivity extends AppCompatActivity {

private TabLayout tabLayout;
private ViewPager viewPager;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tabLayout = findViewById(R.id.tabLayout);
viewPager = findViewById(R.id.viewPager);
TabLayout tabLayout = findViewById(R.id.tabLayout);
ViewPager viewPager = findViewById(R.id.viewPager);

FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter.Builder(this, getSupportFragmentManager())
.add("Common1", new CommonFragment())
.add("Common2", new CommonFragment())
.add("Common", new CommonFragment())
.add("RecyclerView", new RecyclerViewFragment())
.build();
viewPager.setAdapter(adapter);
viewPager.setOffscreenPageLimit(1);
tabLayout.setupWithViewPager(viewPager);

new FirUpdater(this)
.apiToken("3c57fb226edf7facf821501e4eba08d2")
.appId("5cbff890ca87a80abed1b4d8")
.checkVersion();
}

@Override
Expand All @@ -43,12 +42,10 @@ public boolean onCreateOptionsMenu(Menu menu) {

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item_menu_app:
startActivity(new Intent(this, AboutActivity.class));
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == R.id.item_menu_app) {
startActivity(new Intent(this, AboutActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
}
Loading

0 comments on commit ac9b9db

Please sign in to comment.