Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] General documentation cleanup and additions. Adjusts the do…
…cumentation to conform to the multitude of changes that have been made over time.

Very minor code changes were made as well (of which were mostly for formatting). Such as adding override annotations to methods from the Comparable interface, so that they are clearly marked as such.
  • Loading branch information
lioncash committed Oct 2, 2013
1 parent cd6a863 commit b1268bf
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 19 deletions.
Expand Up @@ -17,7 +17,7 @@
import java.io.*;

/**
* The main activity of this emulator.
* The main activity of this emulator front-end.
*/
public final class DolphinEmulator extends Activity
{
Expand Down Expand Up @@ -51,7 +51,6 @@ private void copyFile(InputStream in, OutputStream out) throws IOException
}
}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
Expand Down
Expand Up @@ -120,7 +120,6 @@

/**
* Creates the initial folder structure in /sdcard/dolphin-emu/
*
*/
public static native void CreateUserFolders();

Expand Down
@@ -1,3 +1,9 @@
/**
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
*/

package org.dolphinemu.dolphinemu.emulation;

import android.app.Activity;
Expand Down
Expand Up @@ -14,7 +14,7 @@
import android.view.SurfaceView;

/**
* The surface that rendering is done to.
* The {@link SurfaceView} that rendering is performed on.
*/
public final class NativeGLSurfaceView extends SurfaceView
{
Expand All @@ -26,6 +26,7 @@ public final class NativeGLSurfaceView extends SurfaceView
* Constructor.
*
* @param context The current {@link Context}.
* @param attribs An AttributeSet for retrieving data from XML files.
*/
public NativeGLSurfaceView(Context context, AttributeSet attribs)
{
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.dolphinemu.dolphinemu.gamelist.GameListActivity;

/**
* A basic folder browser {@link Fragment} that allows
* A basic folder browser {@link ListFragment} that allows
* the user to select ISOs/ROMs for playing within the
* emulator.
* <p>
Expand Down
Expand Up @@ -14,6 +14,7 @@
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import org.dolphinemu.dolphinemu.R;
Expand All @@ -22,20 +23,28 @@
* The {@link ArrayAdapter} that backs the file browser.
* <p>
* This is responsible for correctly handling the display
* of the items for the UI.
* of the items for the {@link FolderBrowser} UI.
*/
public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
{
private final Context c;
private final int id;
private final List<FolderBrowserItem> items;

public FolderBrowserAdapter(Context context, int textViewResourceId, List<FolderBrowserItem> objects)
/**
* Constructor
*
* @param context The current {@link Context}.
* @param resourceId The resource ID for a layout file containing a layout to use when instantiating views.
* @param objects The objects to represent in the {@link ListView}.
*/
public FolderBrowserAdapter(Context context, int resourceId, List<FolderBrowserItem> objects)
{
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
super(context, resourceId, objects);

this.c = context;
this.id = resourceId;
this.items = objects;
}

@Override
Expand Down
Expand Up @@ -9,7 +9,7 @@
import java.io.File;

/**
* Represents an item in the folder browser list.
* Represents an item in the {@link FolderBrowser} list.
*/
public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
{
Expand All @@ -22,7 +22,7 @@ public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
* Constructor
*
* @param name The name of the file/folder represented by this item.
* @param subtitle The subtitle of this FolderBrowserItem to display.
* @param subtitle The subtitle of this FolderBrowserItem.
* @param path The path of the file/folder represented by this item.
*/
public FolderBrowserItem(String name, String subtitle, String path)
Expand Down Expand Up @@ -99,6 +99,7 @@ public boolean isDirectory()
return underlyingFile.isDirectory();
}

@Override
public int compareTo(FolderBrowserItem other)
{
if(name != null)
Expand Down
Expand Up @@ -179,6 +179,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
protected void onPostCreate(Bundle savedInstanceState)
{
super.onPostCreate(savedInstanceState);

// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
Expand All @@ -187,6 +188,7 @@ protected void onPostCreate(Bundle savedInstanceState)
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);

// Pass any configuration change to the drawer toggle
mDrawerToggle.onConfigurationChanged(newConfig);
}
Expand All @@ -195,7 +197,7 @@ public void onConfigurationChanged(Configuration newConfig)
public boolean onCreateOptionsMenu(Menu menu)
{
// Only show this in the game list.
if (this.mCurFragmentNum == 0)
if (mCurFragmentNum == 0)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.gamelist_menu, menu);
Expand Down
Expand Up @@ -12,6 +12,7 @@
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.List;
Expand All @@ -29,12 +30,20 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
private final int id;
private final List<GameListItem>items;

public GameListAdapter(Context context, int textViewResourceId, List<GameListItem> objects)
/**
* Constructor
*
* @param context The current {@link Context}.
* @param resourceId The resource ID for a layout file containing a layout to use when instantiating views.
* @param objects The objects to represent in the {@link ListView}.
*/
public GameListAdapter(Context context, int resourceId, List<GameListItem> objects)
{
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
super(context, resourceId, objects);

this.c = context;
this.id = resourceId;
this.items = objects;
}

@Override
Expand Down
Expand Up @@ -112,6 +112,7 @@ public Bitmap getImage()
return image;
}

@Override
public int compareTo(GameListItem o)
{
if (name != null)
Expand Down

0 comments on commit b1268bf

Please sign in to comment.