Android Open Source - edu-video-client First Activity






From Project

Back to project page edu-video-client.

License

The source code is released under:

Apache License

If you think the Android project edu-video-client 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 com.ngm.explaintome;
/*from w  w  w. j av a 2  s .c  om*/
import java.util.ArrayList;
import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View.OnClickListener;

import com.ngm.explaintome.data.Tag;
import com.ngm.explaintome.data.Video;
import com.ngm.explaintome.service.Callback;
import com.ngm.explaintome.service.RestActions;
import com.ngm.explaintome.service.RestActionsImpl;

public class FirstActivity extends BaseActivity {

  private final OnClickListener buttonClickListener = new OnClickListener() {
    public void onClick(android.view.View v) {
      switch (v.getId()) {
      case R.id.first_activity_browse_button:
        launchActvity(BrowseActivity.class);
        break;
      case R.id.first_activity_explain_button:
        Intent i = new Intent(FirstActivity.this, ExplainActivity.class);
        i.putExtra("fromFirst", Boolean.TRUE);
        startActivity(i);
        break;
      case R.id.first_activity_youtube_button:
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Constants.YOUTUBE_CHANNEL_URL);
        startActivity(intent);
        break;
      }
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_first);

    findViewById(R.id.first_activity_browse_button).setOnClickListener(buttonClickListener);
    findViewById(R.id.first_activity_explain_button).setOnClickListener(buttonClickListener);
    findViewById(R.id.first_activity_youtube_button).setOnClickListener(buttonClickListener);

//    testRestActions();
  }

  private void testRestActions() {
    final RestActions actions = new RestActionsImpl(new RestConfig());

    final ArrayList<Tag> tags = new ArrayList<Tag>();
    Tag tag = new Tag();
    tag.setName("BBBB");
    tags.add(tag);

    actions.getVideos(tags, new Callback<List<Video>>(){

      @Override
      public void call(List<Video> result) {
        
      }
      
    });
    
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.first, menu);
    return true;
  }

}




Java Source Code List

com.ngm.exlpaintome.video.VideoControllerView.java
com.ngm.explaintome.BaseActivity.java
com.ngm.explaintome.BaseListActivity.java
com.ngm.explaintome.BrowseActivity.java
com.ngm.explaintome.ColoredSearchView.java
com.ngm.explaintome.Constants.java
com.ngm.explaintome.ExplainActivity.java
com.ngm.explaintome.FilterableEntity.java
com.ngm.explaintome.FirstActivity.java
com.ngm.explaintome.FixedPagerAdapter.java
com.ngm.explaintome.RestConfig.java
com.ngm.explaintome.VideoViewActivity.java
com.ngm.explaintome.VideosActivity.java
com.ngm.explaintome.YoutubeUrlAsyncTask.java
com.ngm.explaintome.data.Answer.java
com.ngm.explaintome.data.ModelElement.java
com.ngm.explaintome.data.QuestionType.java
com.ngm.explaintome.data.Question.java
com.ngm.explaintome.data.Tag.java
com.ngm.explaintome.data.Video.java
com.ngm.explaintome.modules.ModuleProvider.java
com.ngm.explaintome.service.Callback.java
com.ngm.explaintome.service.MockRestActions.java
com.ngm.explaintome.service.RestActionsImpl.java
com.ngm.explaintome.service.RestActions.java