Skip to content

Commit

Permalink
development commit
Browse files Browse the repository at this point in the history
development commit
  • Loading branch information
BharathVishal committed Jun 25, 2021
1 parent a803da2 commit 2ee770d
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 83 deletions.
Binary file modified Screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 21
targetSdkVersion 30
versionCode 30
versionName "1.2.9"
versionName "1.3.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildFeatures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.util.*
*/

@Keep
class ApkInfoExtractor(private val context1: Context) {
class ApkInformationExtractor(private val context1: Context) {


fun appManagerInitValues(): AppManager {
Expand All @@ -45,8 +45,8 @@ class ApkInfoExtractor(private val context1: Context) {

ob.userAppSize = ob.userAppSize + 1
val appPackageName = activityInfo.applicationInfo.packageName.toString()
ob.userApps.add(AppInfo(getAppName(appPackageName), appPackageName, getFirstInstalled(appPackageName),
getLastUpdateed(appPackageName), getAppVersion(appPackageName),
ob.userApps.add(AppInfo(getAppName(appPackageName), appPackageName, getFirstInstalledDate(appPackageName),
getLastUpdatedDate(appPackageName), getAppVersion(appPackageName),
getAppIconURIByPackageName(appPackageName)))

ob.userApps.sortWith(Comparator { o1, o2 -> o1.appName!!.compareTo(o2.appName!!, ignoreCase = true) })
Expand All @@ -55,8 +55,8 @@ class ApkInfoExtractor(private val context1: Context) {
ob.systemAppSize = ob.systemAppSize + 1
val appPackageName = activityInfo.applicationInfo.packageName.toString()

ob.systemApps.add(AppInfo(getAppName(appPackageName), appPackageName, getFirstInstalled(appPackageName),
getLastUpdateed(appPackageName), getAppVersion(appPackageName),
ob.systemApps.add(AppInfo(getAppName(appPackageName), appPackageName, getFirstInstalledDate(appPackageName),
getLastUpdatedDate(appPackageName), getAppVersion(appPackageName),
getAppIconURIByPackageName(appPackageName)))

ob.systemApps.sortWith(Comparator { o1, o2 -> o1.appName!!.compareTo(o2.appName!!, ignoreCase = true) })
Expand Down Expand Up @@ -226,7 +226,7 @@ class ApkInfoExtractor(private val context1: Context) {
return "v$versionName"
}

private fun getFirstInstalled(ApkPackageName: String): String {
private fun getFirstInstalledDate(ApkPackageName: String): String {
var firstInstalled = Constants.SYMBOL_HYPHEN
val manager = context1.packageManager

Expand All @@ -245,7 +245,7 @@ class ApkInfoExtractor(private val context1: Context) {
}


private fun getLastUpdateed(ApkPackageName: String): String {
private fun getLastUpdatedDate(ApkPackageName: String): String {
var lastUpdated = Constants.SYMBOL_HYPHEN
val manager = context1.packageManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ import com.bharathvishal.appmanager.Classes.AppInfo
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions

class AppsAdapter(private val context1: Context, private val appInfoList: MutableList<AppInfo>) : androidx.recyclerview.widget.RecyclerView.Adapter<AppsAdapter.ViewHolder>() {
class AppsAdapter(private val context1: Context, private val appInfoList: MutableList<AppInfo>) :
androidx.recyclerview.widget.RecyclerView.Adapter<AppsAdapter.ViewHolder>() {


class ViewHolder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view) {
var imageView: ImageView = view.findViewById(R.id.imageviewAppManager)
var imageView: ImageView = view.findViewById(R.id.imageviewAppManagerAppLogo)
var textViewAppName: TextView = view.findViewById(R.id.Apk_Name)
var textViewAppPackageName: TextView = view.findViewById(R.id.Apk_Package_Name)
var textViewAppVersion: TextView = view.findViewById(R.id.app_VersionName)
var textViewInstalledOn: TextView = view.findViewById(R.id.installed_On)
var textViewLastUpdateed: TextView = view.findViewById(R.id.last_Updated_Text)
var openAppDetails: Button = view.findViewById(R.id.buttontv_OpenAppDetails)
var openApps: Button = view.findViewById(R.id.buttontv_OpenApp)
var textViewAppPackageName: TextView = view.findViewById(R.id.Apk_Package_NameFull)
var textViewAppVersion: TextView = view.findViewById(R.id.app_VersionNameTV)
var textViewInstalledOn: TextView = view.findViewById(R.id.installed_On_TV)
var textViewLastUpdateed: TextView = view.findViewById(R.id.last_Updated_TV)
var openAppDetails: Button = view.findViewById(R.id.buttontv_OpenAppDetailsBtn)
var openApps: Button = view.findViewById(R.id.buttontv_OpenAppBtn)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AppsAdapter.ViewHolder {
Expand All @@ -55,7 +56,8 @@ class AppsAdapter(private val context1: Context, private val appInfoList: Mutabl
val uri = appInfoList[position].appDrawableURI
try {
if (uri != Uri.EMPTY)
Glide.with(context1).load(uri).apply(RequestOptions().error(R.drawable.ic_android)).into(viewHolder.imageView)
Glide.with(context1).load(uri).apply(RequestOptions().error(R.drawable.ic_android))
.into(viewHolder.imageView)
else {
val img = ContextCompat.getDrawable(context1, R.drawable.ic_android)
viewHolder.imageView.setImageDrawable(img)
Expand Down Expand Up @@ -89,7 +91,8 @@ class AppsAdapter(private val context1: Context, private val appInfoList: Mutabl

viewHolder.openApps.setOnClickListener {
try {
val intent = context1.packageManager.getLaunchIntentForPackage(applicationPackageName!!)
val intent =
context1.packageManager.getLaunchIntentForPackage(applicationPackageName!!)
if (intent != null) {
context1.startActivity(intent)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import android.widget.*
import com.bharathvishal.appmanager.Adapters.ApkInfoExtractor
import com.bharathvishal.appmanager.Adapters.ApkInformationExtractor
import com.bharathvishal.appmanager.Adapters.AppsAdapter
import com.bharathvishal.appmanager.Classes.AppInfo
import com.bharathvishal.appmanager.Classes.AppManager
Expand All @@ -32,7 +32,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {

private lateinit var actvityContext: Context

private var apkInfoExtractor: ApkInfoExtractor? = null
private var apkInformationExtractor: ApkInformationExtractor? = null

internal var arrAppType: Array<String>? = null
private var recyclerViewLayoutManager: RecyclerView.LayoutManager? = null
Expand Down Expand Up @@ -66,7 +66,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
)
binding.spinnerAppType.adapter = spinnerArrayAdapter

apkInfoExtractor = ApkInfoExtractor(this)
apkInformationExtractor = ApkInformationExtractor(this)
recyclerViewLayoutManager = GridLayoutManager(actvityContext, 1)


Expand All @@ -86,7 +86,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
try {
val context1 = contextRef.get()

appManOb = ApkInfoExtractor(context).appManagerInitValues()
appManOb = ApkInformationExtractor(context).appManagerInitValues()

if (appManOb != null) {
numberOfUserApps = Constants.STRING_EMPTY + appManOb!!.userAppSize
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:orientation="vertical"
android:weightSum="2">


<Spinner
android:id="@+id/spinner_App_Type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_gravity="center"
android:gravity="center"
android:layout_margin="3dp"
android:layout_weight="1"
android:fontFamily="sans-serif-condensed"
Expand All @@ -47,8 +48,9 @@


<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
Expand All @@ -61,15 +63,15 @@

<TextView
android:id="@+id/app_Counter_App_Manager"
android:layout_width="match_parent"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:ellipsize="end"
android:fontFamily="sans-serif-condensed"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="1dp"
android:paddingStart="1dp"
android:paddingLeft="1dp"
android:textColor="#000"
android:textSize="15sp" />
</LinearLayout>
Expand Down Expand Up @@ -106,8 +108,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:fontFamily="sans-serif-condensed"
android:maxLines="3"
android:text="@string/no_apps_on_your_device"
Expand Down
Loading

0 comments on commit 2ee770d

Please sign in to comment.