Android Open Source - dttv-android Index Activity






From Project

Back to project page dttv-android.

License

The source code is released under:

GNU General Public License

If you think the Android project dttv-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package dttv.app;
/*  ww  w.  ja  v  a 2 s .c om*/
import dttv.app.compnent.PopWindowCompnent;
import dttv.app.impl.ICallBack;
import dttv.app.utils.Constant;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;

/**
 * index for media file list
 * @author shihx1
 *
 */
@SuppressLint("NewApi")
public class IndexActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.index);
  }
  
  public void open_folder(View v){
    Intent intent = new Intent();
    intent.setClass(this, FileBrowserActivity.class);
    startActivity(intent);
    /*PopWindowCompnent compnent = new PopWindowCompnent(this,this);
    compnent.show(v, true);
    compnent.setCallback(new ICallBack() {
      @Override
      public void doItemClickListener(AdapterView<?> parent, View v,
          int position, long id) {
        // TODO Auto-generated method stub
        super.doItemClickListener(parent, v, position, id);
        TextView effectTxt = (TextView)v.findViewById(android.R.id.text1);
        String effectStr = effectTxt.getText().toString();
        String effectStr2 = Constant.gEqulizerPresets[position];
        Toast.makeText(IndexActivity.this, "effectStr is:"+effectStr+"-0-0 effectStr2 is:"+effectStr2, Toast.LENGTH_LONG).show();
      }
    });*/
  }
  
  public void open_pager(View v){
    /*Intent intent = new Intent();
    intent.setClass(this, MainActivity.class);
    startActivity(intent);*/
    /*PopWindowCompnent compnent = new PopWindowCompnent(this,this);
    compnent.show(v, true);*/
    View view = LayoutInflater.from(this).inflate(R.layout.effect_popwindow, null);
    ListView listView = (ListView)view.findViewById(R.id.pop_listview);
    TextView textView = (TextView)view.findViewById(R.id.pop_window_txt);
    float textSize = textView.getTextSize();
    Log.i("textSize", "----textSize is:"+textSize);
    textView.setTextSize(textSize<18 ? 18 : 21);
    PopupWindow popupWindow = new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    //popupWindow.setBackgroundDrawable(R.drawable.)
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
        android.R.layout.simple_list_item_1, Constant.gEqulizerPresets);
    popupWindow.setAnimationStyle(R.style.pop_win_style);
    ColorDrawable dw = new ColorDrawable(0xb0000000);
    popupWindow.setBackgroundDrawable(dw);
    listView.setAdapter(adapter);
    //popupWindow.showAsDropDown(v);
    int location[] = new int[2];
    v.getLocationOnScreen(location);
    int _x = location[0];
    int _y = location[1] - popupWindow.getHeight();
    popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, _x, _y);
    
    //popupWindow.showAsDropDown(v, _x, _y);
  }
}




Java Source Code List

dttv.app.DtPlayer.java
dttv.app.FileBrowserActivity.java
dttv.app.FileShowActivity.java
dttv.app.IndexActivity.java
dttv.app.MainActivity.java
dttv.app.SettingActivity.java
dttv.app.VideoPlayerActivity.java
dttv.app.adapter.FileAdapter.java
dttv.app.compnent.Compnent.java
dttv.app.compnent.MethodPlayerCompnent.java
dttv.app.compnent.PopWindowCompnent.java
dttv.app.impl.ICallBack.java
dttv.app.impl.I_Async.java
dttv.app.impl.I_KeyIntercept.java
dttv.app.impl.I_OnMyKey.java
dttv.app.impl.I_PopWindow.java
dttv.app.model.Item.java
dttv.app.multithread.DataAsyncTask.java
dttv.app.utils.Constant.java
dttv.app.utils.ControlLightness.java
dttv.app.utils.FileUtil.java
dttv.app.utils.Log.java
dttv.app.utils.MultiMediaTypeUtil.java
dttv.app.utils.MusicUtils.java
dttv.app.utils.PlayerUtil.java
dttv.app.utils.SettingUtil.java
dttv.app.utils.TimesUtil.java
dttv.app.utils.VolumeUtil.java
dttv.app.view.SimpleDialog.java
dttv.app.widget.AudioUIFragment.java
dttv.app.widget.EffectWindow.java
dttv.app.widget.FilesUIFragment.java
dttv.app.widget.GlVideoView.java
dttv.app.widget.OnTouchMoveListener.java
dttv.app.widget.SlideTabsFragment.java
dttv.app.widget.VideoUIFragment.java