-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
105 additions
and
8 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
47 changes: 47 additions & 0 deletions
47
app/src/main/java/freed/cam/ui/themesample/settings/childs/SettingsChild_BooleanSetting.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,47 @@ | ||
package freed.cam.ui.themesample.settings.childs; | ||
|
||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.widget.CompoundButton; | ||
import android.widget.LinearLayout; | ||
import android.widget.Switch; | ||
import android.widget.TextView; | ||
|
||
import com.troop.freedcam.R; | ||
|
||
import freed.settings.SettingKeys; | ||
import freed.settings.SettingsManager; | ||
import freed.settings.mode.ApiBooleanSettingMode; | ||
import freed.settings.mode.GlobalBooleanSettingMode; | ||
|
||
/** | ||
* Created by KillerInk on 05.01.2018. | ||
*/ | ||
|
||
public class SettingsChild_BooleanSetting extends LinearLayout | ||
{ | ||
private TextView description; | ||
|
||
private TextView headerText; | ||
private Switch aSwitch; | ||
private GlobalBooleanSettingMode booleanSettingMode; | ||
|
||
public SettingsChild_BooleanSetting(Context context, final GlobalBooleanSettingMode booleanSettingMode, int headerid, int descriptionid) { | ||
super(context); | ||
this.booleanSettingMode = booleanSettingMode; | ||
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
inflater.inflate(R.layout.settings_booleansettingschild, this); | ||
headerText = (TextView) findViewById(R.id.header); | ||
aSwitch = (Switch) findViewById(R.id.switch1); | ||
aSwitch.setChecked(booleanSettingMode.get()); | ||
aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | ||
@Override | ||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | ||
booleanSettingMode.set(isChecked); | ||
} | ||
}); | ||
description = (TextView) findViewById(R.id.description); | ||
headerText.setText(getResources().getText(headerid)); | ||
description.setText(getResources().getText(descriptionid)); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/uiSettingsBackground" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/header" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:text="TextView" | ||
android:textSize="@dimen/settings_menu_item_header" | ||
android:textColor="@android:color/holo_green_dark" | ||
android:textStyle="bold"/> | ||
|
||
<Switch | ||
android:id="@+id/switch1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:text="" /> | ||
|
||
</LinearLayout> | ||
|
||
<TextView | ||
android:id="@+id/description" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:text="TextView" | ||
android:textSize="@dimen/settings_menu_item_header_value" | ||
android:textColor="@color/uiSettingsTextColor"/> | ||
|
||
</LinearLayout> |
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