• 大小: 246KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-17
  • 语言: Java
  • 标签:

资源简介

MaterialScrollBar An Android library that brings the Material Design 5.1 scrollbar to pre-5.1 devices. Designed for Android's recyclerView. Video Image Preview Google Play - Test Out the App Donate Table of Contents Gradle Documentation How to use My recyclerView elements aren't all the same size! What do I do? Indicators Specific Indicators License Gradle allprojects { repositories { maven { url 'https://jitpack.io' } } } dependencies {    implementation 'com.github.tu

资源截图

代码片段和文件信息

package com.turingtechnologies.materialscrollbardemo;

import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import androidx.appcompat.app.AppCompatActivity;

import com.turingtechnologies.materialscrollbardemo.Activities.MainActivity;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class AppData {

    private static List pkgAppsList;
    static ArrayList pkgLabelList = new ArrayList<>();
    static ArrayList pkgIconList = new ArrayList<>();
    static ArrayList pkgDateList = new ArrayList<>();

    public static void processApps(final AppCompatActivity activity) {
        if(!pkgLabelList.isEmpty()) {
            openMainActivity(activity);
            return;
        }
        //noinspection WrongConstant
        pkgAppsList = activity.getPackageManager().getInstalledApplications(PackageManager.GET_ACTIVITIES);
        for(int i = 0; i < pkgAppsList.size(); i++) {
            if(activity.getPackageManager().getLaunchIntentForPackage(pkgAppsList.get(i).packageName) == null || (!BuildConfig.DEBUG && pkgAppsList.get(i).packageName.contains(AppData.class.getPackage().getName()))) {
                pkgAppsList.remove(i);
                i--;
            }
        }

        new AppInfoTask().execute(activity);
    }

    private static class AppInfoTask extends AsyncTask {

        @Override
        protected AppCompatActivity doInBackground(AppCompatActivity... acts) {
            AppCompatActivity activity = acts[0];
            Collections.sort(pkgAppsList (o1 o2) -> o1.loadLabel(activity.getPackageManager()).toString().compareToIgnoreCase(o2.loadLabel(activity.getPackageManager()).toString()));
            for(ApplicationInfo appInfo : pkgAppsList) {
                pkgLabelList.add(appInfo.loadLabel(activity.getPackageManager()).toString());
                pkgIconList.add(appInfo.loadIcon(activity.getPackageManager()));
                try {
                    pkgDateList.add(activity.getPackageManager().getPackageInfo(appInfo.packageName 0).firstInstallTime);
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                }
            }
            pkgAppsList = null;
            return activity;
        }

        @Override
        protected void onPostExecute(AppCompatActivity activity) {
            openMainActivity(activity);
        }
    };

    private static void openMainActivity(AppCompatActivity activity) {
        Intent main = new Intent(activity.getApplicationContext() MainActivity.class);
        activity.startActivity(main);
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\
     文件         122  2018-11-30 01:21  MaterialScrollBar-master\.gitignore
     文件         226  2018-11-30 01:21  MaterialScrollBar-master\CONTRIBUTING.md
     文件       11357  2018-11-30 01:21  MaterialScrollBar-master\LICENSE
     文件        8641  2018-11-30 01:21  MaterialScrollBar-master\README.md
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\
     文件           7  2018-11-30 01:21  MaterialScrollBar-master\app\.gitignore
     文件         907  2018-11-30 01:21  MaterialScrollBar-master\app\build.gradle
     文件         665  2018-11-30 01:21  MaterialScrollBar-master\app\proguard-rules.pro
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\
     文件        1534  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\AndroidManifest.xml
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\
     文件        2043  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\DateActivity.java
     文件        2688  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\IconActivity.java
     文件        2008  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\MainActivity.java
     文件        2208  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\MultiFragmentActivity.java
     文件        2008  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\NameActivity.java
     文件        1022  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Activities\SplashActivity.java
     文件        2825  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\AppData.java
     文件        2516  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\DemoAdapter.java
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Fragments\
     文件         996  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\Fragments\FirstLetterFragment.java
     文件        1809  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\java\com\turingtechnologies\materialscrollbardemo\IconAdapter.java
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\res\
     目录           0  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\res\layout\
     文件         963  2018-11-30 01:21  MaterialScrollBar-master\app\src\main\res\layout\activity_main.xml
............此处省略83个文件信息

评论

共有 条评论