forked from neobrain/citra
-
Notifications
You must be signed in to change notification settings - Fork 188
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
88 changed files
with
3,256 additions
and
1,116 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
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
136 changes: 136 additions & 0 deletions
136
src/android/app/src/main/java/org/citra/emu/ui/MiiSelectorDialog.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,136 @@ | ||
package org.citra.emu.ui; | ||
|
||
import android.app.AlertDialog; | ||
import android.app.Dialog; | ||
import android.content.DialogInterface; | ||
import android.graphics.drawable.Drawable; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.DialogFragment; | ||
import android.support.v7.widget.LinearLayoutManager; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.CheckBox; | ||
import android.widget.CompoundButton; | ||
import android.widget.TextView; | ||
import com.nononsenseapps.filepicker.DividerItemDecoration; | ||
import java.util.ArrayList; | ||
import org.citra.emu.R; | ||
|
||
public class MiiSelectorDialog extends DialogFragment { | ||
private static final String ARG_CANCEL = "cancel"; | ||
private static final String ARG_TITLE = "title"; | ||
private static final String ARG_MIIS = "miis"; | ||
|
||
public static MiiSelectorDialog newInstance(boolean cancel, String title, String[] miis) { | ||
MiiSelectorDialog fragment = new MiiSelectorDialog(); | ||
Bundle arguments = new Bundle(); | ||
arguments.putBoolean(ARG_CANCEL, cancel); | ||
arguments.putString(ARG_TITLE, title); | ||
arguments.putStringArray(ARG_MIIS, miis); | ||
fragment.setArguments(arguments); | ||
return fragment; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Dialog onCreateDialog(Bundle savedInstanceState) { | ||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); | ||
ViewGroup contents = (ViewGroup)getActivity().getLayoutInflater().inflate( | ||
R.layout.dialog_mii_selector, null); | ||
|
||
Drawable lineDivider = getContext().getDrawable(R.drawable.line_divider); | ||
RecyclerView recyclerView = contents.findViewById(R.id.list_settings); | ||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext()); | ||
recyclerView.setLayoutManager(layoutManager); | ||
MiisAdapter adapter = new MiisAdapter(); | ||
recyclerView.setAdapter(adapter); | ||
recyclerView.addItemDecoration(new DividerItemDecoration(lineDivider)); | ||
builder.setView(contents); | ||
return builder.create(); | ||
} | ||
|
||
@Override | ||
public void onDismiss(DialogInterface dialog) { | ||
super.onDismiss(dialog); | ||
} | ||
|
||
public class SettingsItem {} | ||
|
||
public abstract class SettingViewHolder | ||
extends RecyclerView.ViewHolder implements View.OnClickListener { | ||
public SettingViewHolder(View itemView) { | ||
super(itemView); | ||
itemView.setOnClickListener(this); | ||
findViews(itemView); | ||
} | ||
|
||
protected abstract void findViews(View root); | ||
|
||
public abstract void bind(SettingsItem item); | ||
|
||
public abstract void onClick(View clicked); | ||
} | ||
|
||
public final class CheckBoxSettingViewHolder | ||
extends SettingViewHolder implements CompoundButton.OnCheckedChangeListener { | ||
SettingsItem mItem; | ||
private TextView mTextSettingName; | ||
private CheckBox mCheckbox; | ||
|
||
public CheckBoxSettingViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
|
||
@Override | ||
protected void findViews(View root) { | ||
mTextSettingName = root.findViewById(R.id.text_setting_name); | ||
mCheckbox = root.findViewById(R.id.checkbox); | ||
mCheckbox.setOnCheckedChangeListener(this); | ||
} | ||
|
||
@Override | ||
public void bind(SettingsItem item) { | ||
mItem = item; | ||
// mTextSettingName.setText(item.getName()); | ||
// mCheckbox.setChecked(mItem.getValue() > 0); | ||
} | ||
|
||
@Override | ||
public void onClick(View clicked) { | ||
mCheckbox.toggle(); | ||
// mItem.setValue(mCheckbox.isChecked() ? 1 : 0); | ||
} | ||
|
||
@Override | ||
public void onCheckedChanged(CompoundButton view, boolean isChecked) { | ||
// mItem.setValue(isChecked ? 1 : 0); | ||
} | ||
} | ||
|
||
public class MiisAdapter extends RecyclerView.Adapter<SettingViewHolder> { | ||
private ArrayList<SettingsItem> mSettings; | ||
|
||
public MiisAdapter() {} | ||
|
||
@NonNull | ||
@Override | ||
public SettingViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
LayoutInflater inflater = LayoutInflater.from(parent.getContext()); | ||
View itemView = inflater.inflate(R.layout.list_item_running_checkbox, parent, false); | ||
return new CheckBoxSettingViewHolder(itemView); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return mSettings.size(); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(@NonNull SettingViewHolder holder, int position) { | ||
holder.bind(mSettings.get(position)); | ||
} | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/android/app/src/main/res/layout/dialog_mii_selector.xml
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,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<TextView | ||
android:id="@+id/text_title" | ||
android:text="@string/preferences_settings" | ||
android:textAlignment="center" | ||
android:textColor="@android:color/white" | ||
android:background="@color/citra_orange" | ||
android:layout_alignParentTop="true" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
|
||
<Button | ||
android:id="@+id/button_cancel" | ||
android:layout_alignParentBottom="true" | ||
style="?android:attr/buttonBarButtonStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent"/> | ||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/list_settings" | ||
android:background="@android:color/white" | ||
android:layout_below="@id/text_title" | ||
android:layout_above="@id/button_cancel" | ||
android:layout_width="match_parent" | ||
android:layout_height="300dp"/> | ||
|
||
</RelativeLayout> |
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.
0542855
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greate update. Now on Xiaomi Mi6 I have 29-30 FPS in Pokémon X in town instead 15-17. Game now is playable.
0542855
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice update. In Xiaomi Mi Mix 2s, before in Pokémon Ruby Omega it was 23
27fps, now 2930fps in almost all game :D