Skip to content

Commit

Permalink
Merge pull request #45 from CarlosACepeda/Laboratory
Browse files Browse the repository at this point in the history
Version 0.9.0-alpha1
  • Loading branch information
CarlosACepeda authored Jan 25, 2020
2 parents d60b5e0 + 9dbcfed commit dc6a996
Show file tree
Hide file tree
Showing 82 changed files with 11,530 additions and 6,742 deletions.
15 changes: 6 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Contributing to LiveDisplay

Want to contribute to this project? Great, I like to keep it easy so you can just:
* Submit an issue.
* Submit a fix, from tiny typos to an app-breaking feature/bug
* Propose new features
* Do you know another language that is not localized in the app? Become a translator!
* Submit an issue reporting bugs or suggesting new features.
* Submit a fix using PR's.
* Do you know another language that is not localized in the app? Check my CrowdIn <!missinglink> Project to localize the app as much as possible.


## Report bugs using Github's issues.
Expand All @@ -16,13 +15,11 @@ so here I can find a solution as quick as possible, :)
## Pull Requests
* Fork the repo and make changes to the code.
* Test your code and be sure it works.
* Explain what are you trying to do or solve with examples.
* Stick to the current programming style, so I and you avoid to waste time by making changes such as refactorization, for example.

## I want to help coding...

You're more than welcome! Just fork the project and start coding and submitting PR's!
This app is following the Observable pattern so, you must use it too, so we can keep the app maintainable.

## When coding...

Use good code practices, make code readable and easy to understand, you can also add comments in the code explaining what it does and why,
Use good code practices as, make code readable and easy to understand, you can also add comments in the code explaining what it does and why,
that makes another dev happy in the world ;-)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace LiveDisplay.Activities.ActivitiesEventArgs
{
public class LockScreenLifecycleEventArgs : EventArgs
{
public ActivityStates State { get; set; }
}
}
9 changes: 9 additions & 0 deletions LiveDisplay/Activities/ActivityStates.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace LiveDisplay.Activities
{
public enum ActivityStates
{
Paused = 0,
Resumed = 1,
Destroyed = 2,
}
}
490 changes: 424 additions & 66 deletions LiveDisplay/Activities/BackgroundSettingsActivity.cs

Large diffs are not rendered by default.

71 changes: 58 additions & 13 deletions LiveDisplay/Activities/BlacklistActivity.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
using LiveDisplay.Adapters;
using LiveDisplay.Servicios;
using System.Collections.Generic;
using System.Threading;

namespace LiveDisplay.Activities
namespace LiveDisplay.Activities
{
[Activity(Label = "@string/blacklist", Theme = "@style/LiveDisplayThemeDark")]
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
using Android.Widget;
using LiveDisplay.Adapters;
using LiveDisplay.Misc;
using LiveDisplay.Servicios;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Toolbar = Android.Support.V7.Widget.Toolbar;

[Activity(Label = "@string/blacklist", Theme = "@style/LiveDisplayThemeDark.NoActionBar")]
public class BlacklistActivity : AppCompatActivity
{
private RecyclerView blacklistRecyclerView;
private LinearLayoutManager manager;
private List<PackageInfo> applist;
private Toolbar toolbar;
private ProgressBar loadingblacklistitemsprogressbar;
private EditText searchboxapp;

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

SetContentView(Resource.Layout.BlackList);

// Create your application here
loadingblacklistitemsprogressbar = FindViewById<ProgressBar>(Resource.Id.loadingblacklistitemsprogressbar);
searchboxapp = FindViewById<EditText>(Resource.Id.searchboxapp);
searchboxapp.TextChanged += Searchboxapp_TextChanged;

using (toolbar = FindViewById<Toolbar>(Resource.Id.mainToolbar))
{
SetSupportActionBar(toolbar);
}

blacklistRecyclerView = FindViewById<RecyclerView>(Resource.Id.blacklistRecyclerView);

manager = new LinearLayoutManager(Application.Context);
Expand All @@ -36,5 +51,35 @@ protected override void OnCreate(Bundle savedInstanceState)
}
);
}

private void Searchboxapp_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
{
bool searching = false;
if (!searching) //Is this valid? It does not seem to do anything.
{
searching = true;
loadingblacklistitemsprogressbar.Visibility = Android.Views.ViewStates.Visible;
blacklistRecyclerView.Visibility = Android.Views.ViewStates.Invisible;
ThreadPool.QueueUserWorkItem(method =>
{
if (e.Text.ToString() != string.Empty || e.Text.ToString() != null)
{
applist = Blacklist.GetListOfApps().Where(x => PackageUtils.GetTheAppName(x.PackageName).Contains(e.Text.ToString())).ToList();
}
else
{
applist = Blacklist.GetListOfApps();
}
}
);
RunOnUiThread(() =>
{
blacklistRecyclerView.SetAdapter(new AppsToBeBlacklistedAdapter(applist));
loadingblacklistitemsprogressbar.Visibility = Android.Views.ViewStates.Invisible;
blacklistRecyclerView.Visibility = Android.Views.ViewStates.Visible;
searching = false;
});
}
}
}
}
Loading

0 comments on commit dc6a996

Please sign in to comment.