This repository has been archived by the owner on Jun 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix gradle + appcompat owes from androidx injection enforced by Google
- Fix merging conflicts - Fix toolbar for plugins's settings
- Loading branch information
1 parent
bf29934
commit 011ede4
Showing
28 changed files
with
260 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Feb 12 23:06:48 EET 2019 | ||
#Tue Feb 26 13:44:06 EET 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
179 changes: 179 additions & 0 deletions
179
aware-core/src/main/java/com/aware/ui/AppCompatPreferenceActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
package com.aware.ui; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
import android.content.res.Configuration; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.preference.Preference; | ||
import android.preference.PreferenceActivity; | ||
import android.preference.PreferenceGroup; | ||
import android.support.annotation.LayoutRes; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.ActionBar; | ||
import android.support.v7.app.AppCompatDelegate; | ||
import android.support.v7.widget.*; | ||
import android.util.AttributeSet; | ||
import android.view.MenuInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
/** | ||
* Created by denzil on 09/10/15. | ||
* Inspired by this: https://gist.github.com/StelianMorariu/fcc4db7f677660316a8f | ||
*/ | ||
public abstract class AppCompatPreferenceActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener { | ||
|
||
private AppCompatDelegate mDelegate; | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(String name, Context context, AttributeSet attrs) { | ||
final View result = super.onCreateView(name, context, attrs); | ||
if (result != null) return result; | ||
|
||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { | ||
// If we're running pre-L, we need to 'inject' our tint aware Views in place of the standard framework versions | ||
switch (name) { | ||
case "EditText": | ||
return new AppCompatEditText(this, attrs); | ||
case "Spinner": | ||
return new AppCompatSpinner(this, attrs); | ||
case "CheckBox": | ||
return new AppCompatCheckBox(this, attrs); | ||
case "RadioButton": | ||
return new AppCompatRadioButton(this, attrs); | ||
case "CheckedTextView": | ||
return new AppCompatCheckedTextView(this, attrs); | ||
case "AutoCompleteTextView": | ||
return new AppCompatAutoCompleteTextView(this, attrs); | ||
case "Button": | ||
return new AppCompatButton(this, attrs); | ||
case "RatingBar": | ||
return new AppCompatRatingBar(this, attrs); | ||
case "SeekBar": | ||
return new AppCompatSeekBar(this, attrs); | ||
case "TextView": | ||
return new AppCompatTextView(this, attrs); | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
getDelegate().installViewFactory(); | ||
getDelegate().onCreate(savedInstanceState); | ||
super.onCreate(savedInstanceState); | ||
} | ||
|
||
public PreferenceGroup getPreferenceParent(Preference preference) { | ||
return getPreferenceParent(getPreferenceScreen(), preference); | ||
} | ||
|
||
public PreferenceGroup getPreferenceParent(PreferenceGroup root, Preference preference) { | ||
for (int i = 0; i < root.getPreferenceCount(); i++) { | ||
Preference p = root.getPreference(i); | ||
if (p == preference) | ||
return root; | ||
if (PreferenceGroup.class.isInstance(p)) { | ||
PreferenceGroup parent = getPreferenceParent((PreferenceGroup) p, preference); | ||
if (parent != null) | ||
return parent; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this); | ||
} | ||
|
||
@Override | ||
protected void onPostCreate(Bundle savedInstanceState) { | ||
super.onPostCreate(savedInstanceState); | ||
getDelegate().onPostCreate(savedInstanceState); | ||
} | ||
|
||
public ActionBar getSupportActionBar() { | ||
return getDelegate().getSupportActionBar(); | ||
} | ||
|
||
public void setSupportActionBar(@Nullable Toolbar toolbar) { | ||
getDelegate().setSupportActionBar(toolbar); | ||
} | ||
|
||
@Override | ||
public MenuInflater getMenuInflater() { | ||
return getDelegate().getMenuInflater(); | ||
} | ||
|
||
@Override | ||
public void setContentView(@LayoutRes int layoutResID) { | ||
getDelegate().setContentView(layoutResID); | ||
} | ||
|
||
@Override | ||
public void setContentView(View view) { | ||
getDelegate().setContentView(view); | ||
} | ||
|
||
@Override | ||
public void setContentView(View view, ViewGroup.LayoutParams params) { | ||
getDelegate().setContentView(view, params); | ||
} | ||
|
||
@Override | ||
public void addContentView(View view, ViewGroup.LayoutParams params) { | ||
getDelegate().addContentView(view, params); | ||
} | ||
|
||
@Override | ||
protected void onPostResume() { | ||
super.onPostResume(); | ||
getDelegate().onPostResume(); | ||
} | ||
|
||
@Override | ||
protected void onTitleChanged(CharSequence title, int color) { | ||
super.onTitleChanged(title, color); | ||
getDelegate().setTitle(title); | ||
} | ||
|
||
@Override | ||
public void onConfigurationChanged(Configuration newConfig) { | ||
super.onConfigurationChanged(newConfig); | ||
getDelegate().onConfigurationChanged(newConfig); | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
super.onStop(); | ||
getDelegate().onStop(); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
getDelegate().onDestroy(); | ||
} | ||
|
||
public void invalidateOptionsMenu() { | ||
getDelegate().invalidateOptionsMenu(); | ||
} | ||
|
||
private AppCompatDelegate getDelegate() { | ||
if (mDelegate == null) { | ||
mDelegate = AppCompatDelegate.create(this, null); | ||
} | ||
return mDelegate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Feb 12 23:06:48 EET 2019 | ||
#Tue Feb 26 13:44:06 EET 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.