Skip to content

Commit

Permalink
Renames classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MRezaNasirloo committed Apr 23, 2018
1 parent a7a8c74 commit aa2ad93
Show file tree
Hide file tree
Showing 37 changed files with 154 additions and 201 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sixthsolution.materialpreferencesdemo" >
package="com.mrezanasirloo.preferencezero.sample" >

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.mrezanasirloo.preferencezero.sample;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.mrezanasirloo.preferencezero.preferences.PreferenceCheckBox;
import com.mrezanasirloo.preferencezero.preferences.PreferenceSwitch;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

PreferenceSwitch tempSwitch = (PreferenceSwitch) findViewById(R.id.preferences_measurement_unit);
tempSwitch.setOffText("F");
tempSwitch.setOnText("C");

PreferenceSwitch clockSwitch = (PreferenceSwitch) findViewById(R.id.preferences_clock_format);
clockSwitch.setOffText("24");
clockSwitch.setOnText("12");
PreferenceCheckBox checkBox = (PreferenceCheckBox) findViewById(R.id.preferences_auto_update);
}
}

This file was deleted.

37 changes: 18 additions & 19 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sixthsolution.materialpreferencesdemo.MainActivity"
tools:context=".MainActivity"
android:background="#dcdcdc"
>

Expand All @@ -15,15 +15,14 @@
android:orientation="vertical"
>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader
<com.mrezanasirloo.preferencezero.preferences.PreferencesHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ep_icon="@drawable/default_icon"
app:ep_key="pref_header"
app:ep_title="@string/location_setting"
android:layout_marginBottom="@dimen/default_margin">

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceSwitch
<com.mrezanasirloo.preferencezero.preferences.PreferenceSwitch
android:id="@+id/preferences_auto_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -33,7 +32,7 @@
app:ep_title="@string/auto_location"
/>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceCheckBox
<com.mrezanasirloo.preferencezero.preferences.PreferenceCheckBox
android:id="@+id/preferences_auto_update"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -43,7 +42,7 @@
app:ep_title="Auto Update"
/>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferencesSeekBar
<com.mrezanasirloo.preferencezero.preferences.PreferencesSeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ep_key="pref_seek_bar"
Expand All @@ -52,16 +51,16 @@
app:ep_max_value="15"
/>

</com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader>
</com.mrezanasirloo.preferencezero.preferences.PreferencesHeader>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader
<com.mrezanasirloo.preferencezero.preferences.PreferencesHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ep_key="pref_header"
app:ep_title="@string/clock_date_setting"
android:layout_marginBottom="@dimen/default_margin">

<com.mrezanasirloo.preferencezero.preferences.lists.EasyPreferenceListDialog
<com.mrezanasirloo.preferencezero.preferences.lists.PreferenceListDialog
android:id="@+id/preferences_choose_language"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -73,7 +72,7 @@
app:ep_title="@string/language"
/>

<com.mrezanasirloo.preferencezero.preferences.lists.EasyPreferenceListDialog
<com.mrezanasirloo.preferencezero.preferences.lists.PreferenceListDialog
android:id="@+id/preferences_choose_date_format"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -84,7 +83,7 @@
app:ep_title="@string/date_format"
/>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceSwitch
<com.mrezanasirloo.preferencezero.preferences.PreferenceSwitch
android:id="@+id/preferences_clock_format"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -95,15 +94,15 @@
app:ep_title="@string/clock_format"
/>

</com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader>
</com.mrezanasirloo.preferencezero.preferences.PreferencesHeader>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader
<com.mrezanasirloo.preferencezero.preferences.PreferencesHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ep_key="pref_header"
app:ep_title="@string/weather_settings">

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceSwitch
<com.mrezanasirloo.preferencezero.preferences.PreferenceSwitch
android:id="@+id/preferences_feel_temp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -114,7 +113,7 @@
/>


<com.mrezanasirloo.preferencezero.preferences.lists.EasyPreferenceListDialog
<com.mrezanasirloo.preferencezero.preferences.lists.PreferenceListDialog
android:id="@+id/preferences_choose_weather_provider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -125,7 +124,7 @@
app:ep_title="@string/weather_provider"
/>

<com.mrezanasirloo.preferencezero.preferences.lists.EasyPreferenceListDialog
<com.mrezanasirloo.preferencezero.preferences.lists.PreferenceListDialog
android:id="@+id/preferences_choose_radar_provider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -136,7 +135,7 @@
app:ep_title="@string/radar_provider"
/>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceSwitch
<com.mrezanasirloo.preferencezero.preferences.PreferenceSwitch
android:id="@+id/preferences_measurement_unit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -145,15 +144,15 @@
app:ep_title="@string/measurement_unit"
/>

<com.mrezanasirloo.preferencezero.preferences.EasyPreferenceDialogColorChooser
<com.mrezanasirloo.preferencezero.preferences.PreferenceDialogColorChooser
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ep_key="pref_color_chooser"
app:ep_title="@string/theme_color"
app:ep_default="1"
/>

</com.mrezanasirloo.preferencezero.preferences.EasyPreferencesHeader>
</com.mrezanasirloo.preferencezero.preferences.PreferencesHeader>

</LinearLayout>
</android.support.v4.widget.NestedScrollView>

This file was deleted.

10 changes: 0 additions & 10 deletions preference-zero/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<manifest package="com.mrezanasirloo.preferencezero"
xmlns:android="http://schemas.android.com/apk/res/android"
>

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Its the base class for showing a dialog to user, it is not responsible for any save or load data
*/
public abstract class EasyDialogFragment<T> extends AppCompatDialogFragment implements Showable {
public abstract class DialogFragment<T> extends AppCompatDialogFragment implements Showable {


public interface OnItemSelectedListener<I> {
Expand All @@ -32,7 +32,7 @@ public interface OnItemSelectedListener<I> {
*
* @param listener
*/
public EasyDialogFragment<T> setOnItemSelectedListener(OnItemSelectedListener<T> listener) {
public DialogFragment<T> setOnItemSelectedListener(OnItemSelectedListener<T> listener) {
this.listener = listener;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @author : Pedramrn@gmail.com Created on: 2016-01-07
*/
public class SingleChoiceListDialog extends EasyDialogFragment<Integer> {
public class SingleChoiceListDialog extends DialogFragment<Integer> {
// private TextView tvHeaderTitle;

public SingleChoiceListDialog() {
Expand Down Expand Up @@ -79,6 +79,6 @@ public void onClick(DialogInterface dialog, int which) {
*/
protected View inflateLayout() {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater.inflate(R.layout.easy_preference_list_dialog_header, ((ViewGroup) getView()), false);
return inflater.inflate(R.layout.preference_list_dialog_header, ((ViewGroup) getView()), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
* @author : Pedramrn@gmail.com
* Created on: 2016-01-06
*/
public abstract class EasyPreferenceBoolean extends EasyPreference<Boolean> {
public abstract class PreferenceBoolean extends PreferenceZero<Boolean> {
protected CompoundButton compoundButton;
protected boolean defaultValue = true;

public EasyPreferenceBoolean(Context context, AttributeSet attrs, int defStyleAttr) {
public PreferenceBoolean(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public EasyPreferenceBoolean(Context context, AttributeSet attrs) {
public PreferenceBoolean(Context context, AttributeSet attrs) {
super(context, attrs);
}

public EasyPreferenceBoolean(Context context) {
public PreferenceBoolean(Context context) {
super(context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
/**
* @author : Pedramrn@gmail.com Created on: 2016-01-05
*/
public class EasyPreferenceCheckBox extends EasyPreferenceSwitchCompoundButton {
public class PreferenceCheckBox extends PreferenceSwitchCompoundButton {

public EasyPreferenceCheckBox(Context context) {
public PreferenceCheckBox(Context context) {
super(context);
}

public EasyPreferenceCheckBox(Context context, AttributeSet attrs) {
public PreferenceCheckBox(Context context, AttributeSet attrs) {
super(context, attrs);
}

public EasyPreferenceCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
public PreferenceCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

@Override
public int getLayout() {
return R.layout.easy_preference_checkbox;
return R.layout.preference_checkbox;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@
import com.mrezanasirloo.preferencezero.CircleView;
import com.mrezanasirloo.preferencezero.R;
import com.mrezanasirloo.preferencezero.Showable;
import com.mrezanasirloo.preferencezero.preferences.lists.EasyPreferenceDialog;
import com.mrezanasirloo.preferencezero.preferences.lists.PreferenceDialog;

import petrov.kristiyan.colorpicker.ColorPicker;


/**
* @author : Pedramrn@gmail.com Created on: 2016-01-06
*/
public class EasyPreferenceDialogColorChooser extends EasyPreferenceDialog<Integer> {
public class PreferenceDialogColorChooser extends PreferenceDialog<Integer> {

protected int defaultValue;
protected TextView mTextViewTittle;
private CircleView mFAB;

@Override
protected int getLayout() {
return R.layout.easy_preference_dialog_color_chooser;
return R.layout.preference_dialog_color_chooser;
}

public EasyPreferenceDialogColorChooser(Context context) {
public PreferenceDialogColorChooser(Context context) {
super(context);
init(context, null, 0);
}

public EasyPreferenceDialogColorChooser(Context context, AttributeSet attrs) {
public PreferenceDialogColorChooser(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, 0);
}

public EasyPreferenceDialogColorChooser(Context context, AttributeSet attrs, int defStyleAttr) {
public PreferenceDialogColorChooser(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs, defStyleAttr);
}
Expand All @@ -49,10 +49,10 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr) {

// Load attributes
final TypedArray typedArray = context.obtainStyledAttributes(
attrs, R.styleable.EasyPreference, defStyleAttr, 0);
attrs, R.styleable.PreferenceZero, defStyleAttr, 0);
try {
defaultValue =
Integer.parseInt(typedArray.getString(R.styleable.EasyPreference_ep_default));
Integer.parseInt(typedArray.getString(R.styleable.PreferenceZero_ep_default));
} catch (NumberFormatException e) {
e.printStackTrace();
throw new NumberFormatException(
Expand Down
Loading

0 comments on commit aa2ad93

Please sign in to comment.