Example #1
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.folderex);

    Intent gintent = getIntent();
    getPath = gintent.getStringExtra("path");
    dbPath = gintent.getStringExtra("dbpath");

    FileList _FileList = new FileList(this);
    _FileList.setOnPathChangedListener(_OnPathChanged);
    _FileList.setOnFileSelected(_OnFileSelected);

    LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01);
    layout.addView(_FileList);

    Util.print("getPath = " + getPath);
    String path = " ";

    if (getPath.equals("empty")) {
      File root = Environment.getExternalStorageDirectory();
      _FileList.setPath(root.getAbsolutePath());
      path = root.getAbsolutePath();
    } else {
      _FileList.setPath(getPath);
      path = getPath;
    }

    Util.print("path = " + path);

    _FileList.setFocusable(true);
    _FileList.setFocusableInTouchMode(true);

    ((TextView) findViewById(R.id.TextView01)).setSelected(true);
  }
Example #2
0
  public void onResume() {
    super.onResume();

    // Log.i("WaveLoop", "onStart");

    if (PlayerProxy.instance() == null) {
      // mNowPlayingMain.setEnabled(false);
      // mNowPlayingMain.setVisibility(View.INVISIBLE);

      mWaveLoopMain.removeView(mNowPlayingMain);
      return;
    }

    final AudioInfo audioInfo = PlayerProxy.getAudioInfo();
    if (audioInfo != null) {
      mWaveLoopMain.removeView(mNowPlayingMain);
      mWaveLoopMain.addView(mNowPlayingMain);

      // mNowPlayingMain.setEnabled(true);
      // mNowPlayingMain.setVisibility(View.VISIBLE);

      mNowPlayingArtist.setText(audioInfo.artist);
      mNowPlayingAlbum.setText(audioInfo.album);
      mNowPlayingTitle.setText(audioInfo.title);

      mNowPlayingPlayBtn.setImageResource(
          (PlayerProxy.isPlaying()) ? R.drawable.pause_bkgnd : R.drawable.play_bkgnd);

      mNowPlayingPlayBtn.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              if (PlayerProxy.isPlaying()) PlayerProxy.pause();
              else PlayerProxy.play();

              mNowPlayingPlayBtn.setImageResource(
                  (PlayerProxy.isPlaying()) ? R.drawable.pause_bkgnd : R.drawable.play_bkgnd);
            }
          });

      mNowPlayingBtn.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              Intent i = new Intent(WaveLoopActivity.this, player_main.class);
              i.putExtra("오디오파일경로", (int) audioInfo.dataRowId);
              startActivity(i);
            }
          });
    } else {
      mWaveLoopMain.removeView(mNowPlayingMain);
      // mNowPlayingMain.setEnabled(false);
      // mNowPlayingMain.setVisibility(View.INVISIBLE);
    }
  }
Example #3
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.codelayout);

    LinearLayout MyLinear = (LinearLayout) findViewById(R.id.mylinear);
    MyLinear.setOrientation(LinearLayout.HORIZONTAL);

    Button MyBtn = (Button) findViewById(R.id.mybutton);
    MyBtn.setTextSize(40);

    EditText MyEdit = (EditText) findViewById(R.id.myedit);
    MyEdit.setBackgroundColor(0xff00ff00);
  }
Example #4
0
 @Override
 protected void onPostCreate(Bundle savedInstanceState) {
   super.onPostCreate(savedInstanceState);
   LinearLayout root =
       (LinearLayout) findViewById(android.R.id.list).getParent().getParent().getParent();
   Toolbar bar =
       (Toolbar) LayoutInflater.from(this).inflate(R.layout.settings_toolbar, null, false);
   bar.setNavigationOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           onBackPressed();
         }
       });
   root.addView(bar, 0);
 }
 @Override
 public void onFinishInflate() {
   super.onFinishInflate();
   View view = inflate(getContext(), R.layout.cover_anim_view, (ViewGroup) this);
   Arpan_ßløødy_CoverImages = new ImageView[2];
   Arpan_ßløødy_CoverImages[0] = (ImageView) view.findViewById(R.id.image0);
   Arpan_ßløødy_CoverImages[1] = (ImageView) view.findViewById(R.id.image1);
 }
 @Override
 public void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   ßløødy_ßadßøy_Handler.removeCallbacks(Arpan_Bløødy_ßãdboy);
 }
 @Override
 public void onAttachedToWindow() {
   super.onAttachedToWindow();
   startCoverAnimation();
 }
Example #8
0
  public void onCreate(Bundle savedIntanceState) {
    super.onCreate(savedIntanceState);
    LinearLayout ll = new LinearLayout(this);
    setContentView(ll);
    sv = new SampleView(this);
    ll.addView(sv);

    timer.scheduleAtFixedRate(
        new TimerTask() {

          @Override
          public void run() {
            // TODO 自動生成されたメソッド・スタブ
            try {
              XmlPullParserFactory factory;
              factory = XmlPullParserFactory.newInstance();
              factory.setNamespaceAware(true);
              XmlPullParser xpp = factory.newPullParser();
              String ur =
                  "http://192.168.2.102:8080/otsu/yotsu?zahyou="
                      + aa
                      + "&jikoku="
                      + bb
                      + "&dareka="
                      + cc;
              URL url = new URL(ur);

              URLConnection connection = url.openConnection();
              xpp.setInput(connection.getInputStream(), "UTF-8");

              int eventType = xpp.getEventType();
              String tag = "";

              for (int type = xpp.getEventType();
                  type != XmlPullParser.END_DOCUMENT;
                  type = xpp.next()) {
                switch (type) {
                  case XmlPullParser.START_TAG:
                    tag = xpp.getName();
                    break;
                  case XmlPullParser.TEXT:
                    value = xpp.getText(); // 空白で取得したものは全て処理対象外とする
                    if (value.trim().length() != 0) {
                      if (tag.equals("boody")) {
                        if (value == "n") {
                          // ゲームを停止
                        }
                      }
                    }
                    break;
                  case XmlPullParser.END_TAG: // 終了タグ
                    break;
                }
              } // for終わり
            } catch (XmlPullParserException e) {
              e.printStackTrace();
            } catch (IOException e) {
              e.printStackTrace();
            }

            Time time = new Time("Asia/Tokyo");
            time.setToNow();
            date = time.second;
            co1 = SampleView.x;
            co2 = SampleView.y;

            int co01 = (int) co1;

            aa = String.valueOf(co01);
            bb = String.valueOf(date);
            cc = String.valueOf(dareka);

            try {
              Thread.sleep(0);
            } catch (InterruptedException e) {

            }
          }
        },
        0,
        100);
  }