[Android] General documentation cleanup and additions. Adjusts the documentation 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.
This commit is contained in:
Lioncash 2013-10-02 15:28:02 -04:00
parent cd6a863eec
commit b1268bfcd2
10 changed files with 46 additions and 19 deletions

View File

@ -17,7 +17,7 @@ import org.dolphinemu.dolphinemu.settings.UserPreferences;
import java.io.*;
/**
* The main activity of this emulator.
* The main activity of this emulator front-end.
*/
public final class DolphinEmulator extends Activity
{
@ -51,7 +51,6 @@ public final class DolphinEmulator extends Activity
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{

View File

@ -120,7 +120,6 @@ public final class NativeLibrary
/**
* Creates the initial folder structure in /sdcard/dolphin-emu/
*
*/
public static native void CreateUserFolders();

View File

@ -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;

View File

@ -14,7 +14,7 @@ import android.view.SurfaceHolder;
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
{
@ -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)
{

View File

@ -24,7 +24,7 @@ import org.dolphinemu.dolphinemu.R;
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>

View File

@ -14,6 +14,7 @@ import android.view.View;
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;
@ -22,7 +23,7 @@ import org.dolphinemu.dolphinemu.R;
* 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>
{
@ -30,12 +31,20 @@ public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
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

View File

@ -9,7 +9,7 @@ package org.dolphinemu.dolphinemu.folderbrowser;
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>
{
@ -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)
@ -99,6 +99,7 @@ public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
return underlyingFile.isDirectory();
}
@Override
public int compareTo(FolderBrowserItem other)
{
if(name != null)

View File

@ -179,6 +179,7 @@ public final class GameListActivity extends Activity
protected void onPostCreate(Bundle savedInstanceState)
{
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
@ -187,6 +188,7 @@ public final class GameListActivity extends Activity
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggle
mDrawerToggle.onConfigurationChanged(newConfig);
}
@ -195,7 +197,7 @@ public final class GameListActivity extends Activity
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);

View File

@ -12,6 +12,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import java.util.List;
@ -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

View File

@ -112,6 +112,7 @@ public final class GameListItem implements Comparable<GameListItem>
return image;
}
@Override
public int compareTo(GameListItem o)
{
if (name != null)