mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-10 20:15:54 +00:00
Refactor "repository" to "repo" in class/variable names.
This commit is contained in:
parent
c21315b907
commit
139a6e9b03
8 changed files with 48 additions and 52 deletions
|
@ -28,7 +28,7 @@ import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows {@link RepositoriesFragment} and {@link NodesFragment} in different tabs, and
|
* Shows {@link ReposFragment} and {@link NodesFragment} in different tabs, and
|
||||||
* {@link LocalNodeInfoFragment} in the navigation drawer.
|
* {@link LocalNodeInfoFragment} in the navigation drawer.
|
||||||
*/
|
*/
|
||||||
public class MainActivity extends ActionBarActivity
|
public class MainActivity extends ActionBarActivity
|
||||||
|
@ -82,7 +82,7 @@ public class MainActivity extends ActionBarActivity
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private RepositoriesFragment mRepositoriesFragment;
|
private ReposFragment mRepositoriesFragment;
|
||||||
|
|
||||||
private NodesFragment mNodesFragment;
|
private NodesFragment mNodesFragment;
|
||||||
|
|
||||||
|
@ -137,8 +137,8 @@ public class MainActivity extends ActionBarActivity
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
FragmentManager fm = getSupportFragmentManager();
|
FragmentManager fm = getSupportFragmentManager();
|
||||||
mRepositoriesFragment = (RepositoriesFragment) fm.getFragment(
|
mRepositoriesFragment = (ReposFragment) fm.getFragment(
|
||||||
savedInstanceState, RepositoriesFragment.class.getName());
|
savedInstanceState, ReposFragment.class.getName());
|
||||||
mNodesFragment = (NodesFragment) fm.getFragment(
|
mNodesFragment = (NodesFragment) fm.getFragment(
|
||||||
savedInstanceState, NodesFragment.class.getName());
|
savedInstanceState, NodesFragment.class.getName());
|
||||||
mLocalNodeInfoFragment = (LocalNodeInfoFragment) fm.getFragment(
|
mLocalNodeInfoFragment = (LocalNodeInfoFragment) fm.getFragment(
|
||||||
|
@ -146,7 +146,7 @@ public class MainActivity extends ActionBarActivity
|
||||||
mViewPager.setCurrentItem(savedInstanceState.getInt("currentTab"));
|
mViewPager.setCurrentItem(savedInstanceState.getInt("currentTab"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mRepositoriesFragment = new RepositoriesFragment();
|
mRepositoriesFragment = new ReposFragment();
|
||||||
mNodesFragment = new NodesFragment();
|
mNodesFragment = new NodesFragment();
|
||||||
mLocalNodeInfoFragment = new LocalNodeInfoFragment();
|
mLocalNodeInfoFragment = new LocalNodeInfoFragment();
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ public class MainActivity extends ActionBarActivity
|
||||||
// Avoid crash if called during startup.
|
// Avoid crash if called during startup.
|
||||||
if (mRepositoriesFragment != null && mNodesFragment != null) {
|
if (mRepositoriesFragment != null && mNodesFragment != null) {
|
||||||
FragmentManager fm = getSupportFragmentManager();
|
FragmentManager fm = getSupportFragmentManager();
|
||||||
fm.putFragment(outState, RepositoriesFragment.class.getName(), mRepositoriesFragment);
|
fm.putFragment(outState, ReposFragment.class.getName(), mRepositoriesFragment);
|
||||||
fm.putFragment(outState, NodesFragment.class.getName(), mNodesFragment);
|
fm.putFragment(outState, NodesFragment.class.getName(), mNodesFragment);
|
||||||
fm.putFragment(outState, LocalNodeInfoFragment.class.getName(), mLocalNodeInfoFragment);
|
fm.putFragment(outState, LocalNodeInfoFragment.class.getName(), mLocalNodeInfoFragment);
|
||||||
outState.putInt("currentTab", mViewPager.getCurrentItem());
|
outState.putInt("currentTab", mViewPager.getCurrentItem());
|
||||||
|
|
|
@ -20,7 +20,6 @@ import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.util.NodeAdapter;
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||||
|
import com.nutomic.syncthingandroid.util.NodeAdapter;
|
||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
|
@ -17,11 +17,11 @@ import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.util.ExtendedCheckBoxPreference;
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
||||||
|
import com.nutomic.syncthingandroid.util.ExtendedCheckBoxPreference;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -37,7 +37,7 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
|
|
||||||
public static final String ACTION_EDIT = "edit";
|
public static final String ACTION_EDIT = "edit";
|
||||||
|
|
||||||
public static final String KEY_REPOSITORY_ID = "repository_id";
|
public static final String KEY_REPO_ID = "repository_id";
|
||||||
|
|
||||||
private static final String KEY_NODE_SHARED = "node_shared";
|
private static final String KEY_NODE_SHARED = "node_shared";
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private RestApi.Repository mRepository;
|
private RestApi.Repository mRepo;
|
||||||
|
|
||||||
private EditTextPreference mRepositoryId;
|
private EditTextPreference mRepositoryId;
|
||||||
|
|
||||||
|
@ -101,11 +101,11 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
public void onApiAvailable() {
|
public void onApiAvailable() {
|
||||||
if (getIntent().getAction().equals(ACTION_CREATE)) {
|
if (getIntent().getAction().equals(ACTION_CREATE)) {
|
||||||
setTitle(R.string.create_repo);
|
setTitle(R.string.create_repo);
|
||||||
mRepository = new RestApi.Repository();
|
mRepo = new RestApi.Repository();
|
||||||
mRepository.ID = "";
|
mRepo.ID = "";
|
||||||
mRepository.Directory = "";
|
mRepo.Directory = "";
|
||||||
mRepository.Nodes = new ArrayList<RestApi.Node>();
|
mRepo.Nodes = new ArrayList<RestApi.Node>();
|
||||||
mRepository.Versioning = new RestApi.Versioning();
|
mRepo.Versioning = new RestApi.Versioning();
|
||||||
getPreferenceScreen().removePreference(mDelete);
|
getPreferenceScreen().removePreference(mDelete);
|
||||||
}
|
}
|
||||||
else if (getIntent().getAction().equals(ACTION_EDIT)) {
|
else if (getIntent().getAction().equals(ACTION_EDIT)) {
|
||||||
|
@ -113,18 +113,18 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
mRepositoryId.setEnabled(false);
|
mRepositoryId.setEnabled(false);
|
||||||
List<RestApi.Repository> repos = mSyncthingService.getApi().getRepositories();
|
List<RestApi.Repository> repos = mSyncthingService.getApi().getRepositories();
|
||||||
for (int i = 0; i < repos.size(); i++) {
|
for (int i = 0; i < repos.size(); i++) {
|
||||||
if (repos.get(i).ID.equals(getIntent().getStringExtra(KEY_REPOSITORY_ID))) {
|
if (repos.get(i).ID.equals(getIntent().getStringExtra(KEY_REPO_ID))) {
|
||||||
mRepository = repos.get(i);
|
mRepo = repos.get(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mRepositoryId.setText(mRepository.ID);
|
mRepositoryId.setText(mRepo.ID);
|
||||||
mRepositoryId.setSummary(mRepository.ID);
|
mRepositoryId.setSummary(mRepo.ID);
|
||||||
mDirectory.setText(mRepository.Directory);
|
mDirectory.setText(mRepo.Directory);
|
||||||
mDirectory.setSummary(mRepository.Directory);
|
mDirectory.setSummary(mRepo.Directory);
|
||||||
mRepositoryMaster.setChecked(mRepository.ReadOnly);
|
mRepositoryMaster.setChecked(mRepo.ReadOnly);
|
||||||
List<RestApi.Node> nodesList = mSyncthingService.getApi().getNodes();
|
List<RestApi.Node> nodesList = mSyncthingService.getApi().getNodes();
|
||||||
for (RestApi.Node n : nodesList) {
|
for (RestApi.Node n : nodesList) {
|
||||||
ExtendedCheckBoxPreference cbp =
|
ExtendedCheckBoxPreference cbp =
|
||||||
|
@ -133,17 +133,17 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
cbp.setKey(KEY_NODE_SHARED);
|
cbp.setKey(KEY_NODE_SHARED);
|
||||||
cbp.setOnPreferenceChangeListener(RepoSettingsActivity.this);
|
cbp.setOnPreferenceChangeListener(RepoSettingsActivity.this);
|
||||||
cbp.setChecked(false);
|
cbp.setChecked(false);
|
||||||
for (RestApi.Node n2 : mRepository.Nodes) {
|
for (RestApi.Node n2 : mRepo.Nodes) {
|
||||||
if (n2.NodeID.equals(n.NodeID)) {
|
if (n2.NodeID.equals(n.NodeID)) {
|
||||||
cbp.setChecked(true);
|
cbp.setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mNodes.addPreference(cbp);
|
mNodes.addPreference(cbp);
|
||||||
}
|
}
|
||||||
mVersioning.setChecked(mRepository.Versioning instanceof RestApi.SimpleVersioning);
|
mVersioning.setChecked(mRepo.Versioning instanceof RestApi.SimpleVersioning);
|
||||||
if (mVersioning.isChecked()) {
|
if (mVersioning.isChecked()) {
|
||||||
mVersioningKeep.setText(mRepository.Versioning.getParams().get("keep"));
|
mVersioningKeep.setText(mRepo.Versioning.getParams().get("keep"));
|
||||||
mVersioningKeep.setSummary(mRepository.Versioning.getParams().get("keep"));
|
mVersioningKeep.setSummary(mRepo.Versioning.getParams().get("keep"));
|
||||||
mVersioningKeep.setEnabled(true);
|
mVersioningKeep.setEnabled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -167,15 +167,15 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.create:
|
case R.id.create:
|
||||||
if (mRepository.ID.equals("")) {
|
if (mRepo.ID.equals("")) {
|
||||||
Toast.makeText(this, R.string.repo_id_required, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.repo_id_required, Toast.LENGTH_LONG).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mRepository.Directory.equals("")) {
|
if (mRepo.Directory.equals("")) {
|
||||||
Toast.makeText(this, R.string.repo_path_required, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.repo_path_required, Toast.LENGTH_LONG).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
mSyncthingService.getApi().editRepository(mRepository, true);
|
mSyncthingService.getApi().editRepository(mRepo, true);
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -196,17 +196,17 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preference.equals(mRepositoryId)) {
|
if (preference.equals(mRepositoryId)) {
|
||||||
mRepository.ID = (String) o;
|
mRepo.ID = (String) o;
|
||||||
repositoryUpdated();
|
repositoryUpdated();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (preference.equals(mDirectory)) {
|
else if (preference.equals(mDirectory)) {
|
||||||
mRepository.Directory = (String) o;
|
mRepo.Directory = (String) o;
|
||||||
repositoryUpdated();
|
repositoryUpdated();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (preference.equals(mRepositoryMaster)) {
|
else if (preference.equals(mRepositoryMaster)) {
|
||||||
mRepository.ReadOnly = (Boolean) o;
|
mRepo.ReadOnly = (Boolean) o;
|
||||||
repositoryUpdated();
|
repositoryUpdated();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -214,12 +214,12 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
ExtendedCheckBoxPreference pref = (ExtendedCheckBoxPreference) preference;
|
ExtendedCheckBoxPreference pref = (ExtendedCheckBoxPreference) preference;
|
||||||
RestApi.Node node = (RestApi.Node) pref.getObject();
|
RestApi.Node node = (RestApi.Node) pref.getObject();
|
||||||
if ((Boolean) o) {
|
if ((Boolean) o) {
|
||||||
mRepository.Nodes.add(node);
|
mRepo.Nodes.add(node);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (RestApi.Node n : mRepository.Nodes) {
|
for (RestApi.Node n : mRepo.Nodes) {
|
||||||
if (n.NodeID.equals(node.NodeID)) {
|
if (n.NodeID.equals(node.NodeID)) {
|
||||||
mRepository.Nodes.remove(n);
|
mRepo.Nodes.remove(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,19 +230,19 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
mVersioningKeep.setEnabled((Boolean) o);
|
mVersioningKeep.setEnabled((Boolean) o);
|
||||||
if ((Boolean) o) {
|
if ((Boolean) o) {
|
||||||
RestApi.SimpleVersioning v = new RestApi.SimpleVersioning();
|
RestApi.SimpleVersioning v = new RestApi.SimpleVersioning();
|
||||||
mRepository.Versioning = v;
|
mRepo.Versioning = v;
|
||||||
v.setParams(5);
|
v.setParams(5);
|
||||||
mVersioningKeep.setText("5");
|
mVersioningKeep.setText("5");
|
||||||
mVersioningKeep.setSummary("5");
|
mVersioningKeep.setSummary("5");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mRepository.Versioning = new RestApi.Versioning();
|
mRepo.Versioning = new RestApi.Versioning();
|
||||||
}
|
}
|
||||||
repositoryUpdated();
|
repositoryUpdated();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (preference.equals(mVersioningKeep)) {
|
else if (preference.equals(mVersioningKeep)) {
|
||||||
((RestApi.SimpleVersioning) mRepository.Versioning)
|
((RestApi.SimpleVersioning) mRepo.Versioning)
|
||||||
.setParams(Integer.parseInt((String) o));
|
.setParams(Integer.parseInt((String) o));
|
||||||
repositoryUpdated();
|
repositoryUpdated();
|
||||||
return true;
|
return true;
|
||||||
|
@ -259,7 +259,7 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
mSyncthingService.getApi().deleteRepository(mRepository);
|
mSyncthingService.getApi().deleteRepository(mRepo);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -272,7 +272,7 @@ public class RepoSettingsActivity extends PreferenceActivity
|
||||||
|
|
||||||
private void repositoryUpdated() {
|
private void repositoryUpdated() {
|
||||||
if (getIntent().getAction().equals(ACTION_EDIT)) {
|
if (getIntent().getAction().equals(ACTION_EDIT)) {
|
||||||
mSyncthingService.getApi().editRepository(mRepository, false);
|
mSyncthingService.getApi().editRepository(mRepo, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
import com.nutomic.syncthingandroid.util.RepositoryAdapter;
|
|
||||||
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||||
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||||
|
import com.nutomic.syncthingandroid.util.ReposAdapter;
|
||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
@ -15,10 +15,10 @@ import java.util.TimerTask;
|
||||||
/**
|
/**
|
||||||
* Displays a list of all existing repositories.
|
* Displays a list of all existing repositories.
|
||||||
*/
|
*/
|
||||||
public class RepositoriesFragment extends LoadingListFragment implements
|
public class ReposFragment extends LoadingListFragment implements
|
||||||
RestApi.OnApiAvailableListener, AdapterView.OnItemClickListener {
|
RestApi.OnApiAvailableListener, AdapterView.OnItemClickListener {
|
||||||
|
|
||||||
private RepositoryAdapter mAdapter;
|
private ReposAdapter mAdapter;
|
||||||
|
|
||||||
private Timer mTimer;
|
private Timer mTimer;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class RepositoriesFragment extends LoadingListFragment implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitAdapter(MainActivity activity) {
|
public void onInitAdapter(MainActivity activity) {
|
||||||
mAdapter = new RepositoryAdapter(activity);
|
mAdapter = new ReposAdapter(activity);
|
||||||
mAdapter.add(activity.getApi().getRepositories());
|
mAdapter.add(activity.getApi().getRepositories());
|
||||||
setListAdapter(mAdapter, R.string.repositories_list_empty);
|
setListAdapter(mAdapter, R.string.repositories_list_empty);
|
||||||
mInitialized = true;
|
mInitialized = true;
|
||||||
|
@ -66,7 +66,7 @@ public class RepositoriesFragment extends LoadingListFragment implements
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
Intent intent = new Intent(getActivity(), RepoSettingsActivity.class);
|
Intent intent = new Intent(getActivity(), RepoSettingsActivity.class);
|
||||||
intent.setAction(RepoSettingsActivity.ACTION_EDIT);
|
intent.setAction(RepoSettingsActivity.ACTION_EDIT);
|
||||||
intent.putExtra(RepoSettingsActivity.KEY_REPOSITORY_ID, mAdapter.getItem(i).ID);
|
intent.putExtra(RepoSettingsActivity.KEY_REPO_ID, mAdapter.getItem(i).ID);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,12 +5,9 @@ import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Parcel;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.BuildConfig;
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
|
|
@ -17,12 +17,12 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* Generates item views for repository items.
|
* Generates item views for repository items.
|
||||||
*/
|
*/
|
||||||
public class RepositoryAdapter extends ArrayAdapter<RestApi.Repository>
|
public class ReposAdapter extends ArrayAdapter<RestApi.Repository>
|
||||||
implements RestApi.OnReceiveModelListener {
|
implements RestApi.OnReceiveModelListener {
|
||||||
|
|
||||||
private HashMap<String, RestApi.Model> mModels = new HashMap<String, RestApi.Model>();
|
private HashMap<String, RestApi.Model> mModels = new HashMap<String, RestApi.Model>();
|
||||||
|
|
||||||
public RepositoryAdapter(Context context) {
|
public ReposAdapter(Context context) {
|
||||||
super(context, R.layout.node_list_item);
|
super(context, R.layout.node_list_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class RepositoryAdapter extends ArrayAdapter<RestApi.Repository>
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
LayoutInflater inflater = (LayoutInflater) getContext()
|
LayoutInflater inflater = (LayoutInflater) getContext()
|
||||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
convertView = inflater.inflate(R.layout.repository_list_item, parent, false);
|
convertView = inflater.inflate(R.layout.repo_list_item, parent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView id = (TextView) convertView.findViewById(R.id.id);
|
TextView id = (TextView) convertView.findViewById(R.id.id);
|
Loading…
Reference in a new issue