Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #145 from lioncash/split-about-activity
[Android] Split the AboutFragmentItem and InfoFragmentAdapter into their own class files.
- Loading branch information
Showing
9 changed files
with
153 additions
and
98 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
49 changes: 49 additions & 0 deletions
49
Source/Android/src/org/dolphinemu/dolphinemu/about/AboutFragmentItem.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,49 @@ | ||
| /** | ||
| * Copyright 2014 Dolphin Emulator Project | ||
| * Licensed under GPLv2 | ||
| * Refer to the license.txt file included. | ||
| */ | ||
|
|
||
| package org.dolphinemu.dolphinemu.about; | ||
|
|
||
| /** | ||
| * Represents an item within an info | ||
| * {@list Fragment} in the About menu. | ||
| */ | ||
| final class AboutFragmentItem | ||
| { | ||
| private final String title; | ||
| private final String subtitle; | ||
|
|
||
| /** | ||
| * Constructor | ||
| * | ||
| * @param title The title of this item. | ||
| * @param subtitle The subtitle for this item. | ||
| */ | ||
| public AboutFragmentItem(String title, String subtitle) | ||
| { | ||
| this.title = title; | ||
| this.subtitle = subtitle; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the title of this item. | ||
| * | ||
| * @return the title of this item. | ||
| */ | ||
| public String getTitle() | ||
| { | ||
| return title; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the subtitle of this item. | ||
| * | ||
| * @return the subtitle of this item. | ||
| */ | ||
| public String getSubTitle() | ||
| { | ||
| return subtitle; | ||
| } | ||
| } |
67 changes: 67 additions & 0 deletions
67
Source/Android/src/org/dolphinemu/dolphinemu/about/AboutInfoFragmentAdapter.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,67 @@ | ||
| /** | ||
| * Copyright 2014 Dolphin Emulator Project | ||
| * Licensed under GPLv2 | ||
| * Refer to the license.txt file included. | ||
| */ | ||
|
|
||
| package org.dolphinemu.dolphinemu.about; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.dolphinemu.dolphinemu.R; | ||
|
|
||
| import android.content.Context; | ||
| import android.view.LayoutInflater; | ||
| import android.view.View; | ||
| import android.view.ViewGroup; | ||
| import android.widget.ArrayAdapter; | ||
| import android.widget.TextView; | ||
|
|
||
| /** | ||
| * {@link ArrayAdapter} subclass specifically for the | ||
| * information fragments within the about menu. | ||
| */ | ||
| final class AboutInfoFragmentAdapter extends ArrayAdapter<AboutFragmentItem> | ||
| { | ||
| private final int id; | ||
| private final List<AboutFragmentItem> items; | ||
|
|
||
| public AboutInfoFragmentAdapter(Context ctx, int id, List<AboutFragmentItem> items) | ||
| { | ||
| super(ctx, id, items); | ||
|
|
||
| this.id = id; | ||
| this.items = items; | ||
| } | ||
|
|
||
| @Override | ||
| public AboutFragmentItem getItem(int index) | ||
| { | ||
| return items.get(index); | ||
| } | ||
|
|
||
| @Override | ||
| public View getView(int position, View convertView, ViewGroup parent) | ||
| { | ||
| if (convertView == null) | ||
| { | ||
| LayoutInflater vi = LayoutInflater.from(getContext()); | ||
| convertView = vi.inflate(id, parent, false); | ||
| } | ||
|
|
||
| final AboutFragmentItem item = items.get(position); | ||
| if (item != null) | ||
| { | ||
| TextView title = (TextView) convertView.findViewById(R.id.AboutItemTitle); | ||
| TextView subtitle = (TextView) convertView.findViewById(R.id.AboutItemSubTitle); | ||
|
|
||
| if (title != null) | ||
| title.setText(item.getTitle()); | ||
|
|
||
| if (subtitle != null) | ||
| subtitle.setText(item.getSubTitle()); | ||
| } | ||
|
|
||
| return convertView; | ||
| } | ||
| } |
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
6 changes: 6 additions & 0 deletions
6
Source/Android/src/org/dolphinemu/dolphinemu/about/Limit.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