Android Open Source - EulerSolutions Solution Display Fragment






From Project

Back to project page EulerSolutions.

License

The source code is released under:

MIT License

If you think the Android project EulerSolutions 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.eulersolutions.controllers;
/*  ww  w .  j av a2  s  .  c  om*/
import com.eulersolutions.interfaces.ISolutionDisplay;
import com.eulersolutions.interfaces.ISolutionHandler;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class SolutionDisplayFragment extends Fragment implements ISolutionDisplay{
  
  private static final String TAG = "EulerSolutions-SolutionDisplayFragment";
  
  private TextView solutionDisplay;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState)
  {
    Log.i(TAG, "Entered onCreateView");
    return inflater.inflate(R.layout.fragment_solution_display, container, false);
  }
  
  @Override
  public void onAttach(Activity activity)
  {
    Log.i(TAG, "entered onAttach");
    ISolutionHandler handler;
    
    super.onAttach(activity);
    
    if(activity instanceof ISolutionHandler)
    {
      handler = (ISolutionHandler) activity;
      handler.setSolutionDisplay(this);
    }
  }
  
  @Override
  public void setSolution(String solution) {
    Log.i(TAG, "entered Set Solution");
    solutionDisplay = (TextView) this.getView().findViewById(R.id.solutionDisplayTextView);
    solutionDisplay.setText(solution);
  }
}




Java Source Code List

com.eulersolutions.controllers.MainActivity.java
com.eulersolutions.controllers.ProblemPresentationActivity.java
com.eulersolutions.controllers.ProblemSelectArrayAdapter.java
com.eulersolutions.controllers.ProblemSolutionActivity.java
com.eulersolutions.controllers.SolutionDisplayFragment.java
com.eulersolutions.controllers.SolutionSelectFragment.java
com.eulersolutions.interfaces.ISelectionListener.java
com.eulersolutions.interfaces.ISolutionDisplay.java
com.eulersolutions.interfaces.ISolutionHandler.java
com.eulersolutions.model.CompletedProblems.java
com.eulersolutions.model.EvenFibonacciNmCalculator.java
com.eulersolutions.model.LargestPrimeFactorCalculator.java
com.eulersolutions.model.MultiplesABCalculator.java
com.eulersolutions.model.ProblemCalculator.java
com.eulersolutions.model.ProblemSummary.java