GridEditingActivity.java
Dosyayı İndir
package com.godoro.androideditors;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
public class GridEditingActivity extends Activity {
private List<GridEditingEntity> entityList;
private ListView editingListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_grid_editing);
editingListView=(ListView) findViewById(R.id.editingListView);
editingListView.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
editingListView.setItemsCanFocus(true);
selectEntityList();
showEditingList();
}
private void showEditingList(){
final GridEditingAdapter listAdapter=new GridEditingAdapter(this,entityList);
editingListView.setAdapter(listAdapter);
}
private void selectEntityList(){
entityList=new ArrayList<GridEditingEntity>();
entityList.add(new GridEditingEntity(301,"Java & OOP",1200,true));
entityList.add(new GridEditingEntity(301,"JDBC, JAXP, JAJP",1200,true));
entityList.add(new GridEditingEntity(303,"AWT, Applet, Swing, JavaFX ",1500,false));
entityList.add(new GridEditingEntity(304,"JSP & Servlet",1500,false));
entityList.add(new GridEditingEntity(305,"JPA, Hibernate",1500,true));
entityList.add(new GridEditingEntity(306,"JSF, PrimeFaces",1500,true));
entityList.add(new GridEditingEntity(307,"Patterns, IoC, CDI, Spring",1500,false));
entityList.add(new GridEditingEntity(308,"EJB, JMS; JAX-WS, JAX-RS",1200,true));
}
public void onSaveClick(View view) {
for(GridEditingEntity entity : entityList){
String message=entity.getEntityId()+" "
+entity.getEntityName()+" "
+entity.getEntityValue()+" "
+entity.isEntityChecked();
Toast.makeText(GridEditingActivity.this,message,Toast.LENGTH_SHORT).show();
}
}
}
Dosyayı İndir